There appears to be an issue in B4A where resources are not updated on the device when they are changed & the app is recompiled.
In an app I'm currently working on, I had a bunch of .png files whose names started with "icon_". After running the app on multiple devices for several weeks, today I changed the file names so they start with "ic_". After doing this, I removed all the old files (starting with "icon_") using the IDE file manager, then added the new files (starting with "ic_").
When I compiled the app & ran it on a device, it crashed with the following error:
The file being reported as not found ("icon_person_black_24dp.png") was one of the files I changed to start with "ic_". The only way I could get the app to run was to uninstall it from the device, then recompile & install it. I had to do this on all my devices that had previously run the app.
Is there a way to force B4A to update the resources when the app is recompiled?
- Colin.
In an app I'm currently working on, I had a bunch of .png files whose names started with "icon_". After running the app on multiple devices for several weeks, today I changed the file names so they start with "ic_". After doing this, I removed all the old files (starting with "icon_") using the IDE file manager, then added the new files (starting with "ic_").
When I compiled the app & ran it on a device, it crashed with the following error:
*** Service (starter) Create ***
** Service (starter) Start **
*** Service (firebasemessaging) Create ***
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (firebasemessaging) Start **
java.lang.RuntimeException: java.io.FileNotFoundException: icon_person_black_24dp.png
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1679)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.io.FileNotFoundException: icon_person_black_24dp.png
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:313)
at android.content.res.AssetManager.open(AssetManager.java:287)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:202)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:515)
at anywheresoftware.b4a.keywords.Common.LoadBitmap(Common.java:1315)
at com.airlinemates.followme.apputils._vvvvvv2(apputils.java:249)
at com.airlinemates.followme.main._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv2(main.java:2086)
at com.airlinemates.followme.main._vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv3(main.java:1357)
at com.airlinemates.followme.main$ResumableSub_Activity_Create.resume(main.java:647)
at anywheresoftware.b4a.keywords.Common$13.run(Common.java:1677)
... 7 more
The file being reported as not found ("icon_person_black_24dp.png") was one of the files I changed to start with "ic_". The only way I could get the app to run was to uninstall it from the device, then recompile & install it. I had to do this on all my devices that had previously run the app.
Is there a way to force B4A to update the resources when the app is recompiled?
- Colin.