Errors in copying projects

I had app X, which was working fine. It involves saving and deleting some image files to folders I created in external storage (using extensions). With new requirement for moving files to app-specific folders, I copied X to X_copy and starting making the necessary updates and changes in file locations. X_copy fixed much of what I needed, so to preserve those changes and make more, I copied X_copy to X_copy_copy. Everything is now working fine (I've just been downloading APKs to my phone or tablet, both running Android 10, too hard to figure out file locations with Companion, uninstalling old versions and installing new versions).

Now my problem is that I have deleted project X from the AI2 system, and then copied X_copy_copy to a new version of X to get it ready to publish. But it has errors and even misspellings in it (I've repeated this a few time), some of which were in the original X but are definitely not in X_copy_copy. I've copied X_copy_copy to Y, and that works also fine, but of course it changes the app name, and I don't want that. Copying Y to a new version of X also doesn't work, the new X has the same original errors in it. Lastly, copying X_copy_copy to a new version of X_copy retains some of the errors that were still in the original version of that.

I've done updates this way for a few years and have never had a problem editing copies of apps and then finally deleting the original and making a new version from the copy.

Can anyone shed light on how this is happening?

Thanks! So in my copy, the app name is the original app name. So when I load the APK to my phone, it shows up with the new file's name as the app name. But will things be okay when I put it into the Play Store?

And any reason you can think of that I can't save it to the original name?

probably your old project X is still in the Trash?
just remove it form the Trash to be able to rename the project to X...

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

Sorry, I meant why can't I save it to the original name without the issues that I'm reporting. I can easily delete X from trash and copy Y to X. The problem is that X now has errors in it that are not in Y.

Seriously, I think there is a bug in how this app is being compiled. In my file Y, I had a single block to make a file "dummy.png" from the Canvas, since I wanted to see where that file ended up. I deleted that block two or three versions ago, it's definitely gone, and Y works fine. But if I delete X and I copy Y back to X, that file starts being created again. And the application-specific directory that is created from X is /data/..../Y/files, not /data.../X/files. The app name is correct on Screen1 of X and Y.

I also got the impression when I was problem-solving this that disabled blocks are being included in the complied APK, although I have not tested this more rigorously.

I've been doing this for a few years and have never had this kind of problem deleting and recreating projects in AI2. Is it possible that the app-specific directory blocks are introducing these problems, this is the first time i have used them.

somehow I got confused trying to follow your description of copying files etc...
What about always exporting project X to create backups of your work and just working on project X without copying at all?

Taifun

Thanks, sorry it's confusing. But this is the problem, it seems. When I make changes to X (like deleting a block), it seems to keep that block in the compile code, unless I change the file name to Y. But then I can't change the Y name back to X without that error coming back.

you could try to uninstall your previous project X before reinstalling the new X
and in case you like to upgrade your project X from version 1 to version 2, increment version name and version code in the Screen1 properties and then update your app X

Taifun

Thanks, I've tried both, and still the same problem.

I did a simple experiment last night. I took X, added a simple label to Screen 1,"Hi!". It works fine in Companion, but when I build an APK and load that onto my phone, the label isn't there. I do the same thing in Y, it works fine. I delte X and then copy Y to X, no label. I've never had any problems like this before. I'm uninstalling X from my phone each time.

you might want to add your test project X (aia and apk file) here into this thread, so someone can take a look

Taifun

GrowthPlot.aia (1.5 MB)

So it doesn't look like I'm allowed to download APK files to here, but here is the AIA, and two screenshots. I deleted the simple label "Hi!" from the app on AI2, as you can see on Companion. But when I compile the APK and run it on my phone, you can see that the "Hi!" label is still there.

Happy to share the APK another way.

No, but I get a Runtime Error with Companion & APK:

So check / fix this, remove (uninstall) all previous versions from your device and try again.

Wow, that's so weird. That error that you're getting is an old one, that was fixed a number of versions ago. Sometimes the app will run when you close it and restart it , the error won't appear the second time.

May I ask which version of Android you're running?

But it's very odd that we're getting different results from the same AIA (although admittedly, you probably imported the AIA into AI2, made an APK and ran that), while I'm running straight from the APK. I have uninstalled all previous versions of this app from my device.

The error also occurs when restarting the app.

???

Android 9 (Galaxy Note8).

I will soon remove the APK from Google Drive. So let me know when you got it.

Very strange. I do have the APK now, thanks for doing that, and it works completely fine on my android 10 Samsung tablet. Not getting that error message.

That error message pops up when you don't have read/write permission for the internal drive, and it tries to measure the height and width of an image file. With my app, that's the first thing that it asks you, for file operation permission.

Permission was granted.
Release an internal test track in the Play Developer Console and check the Pre-launch report (on the 10 test devices).

Thanks, that's an excellent idea.