Android Question Build in release mode don't copy Assets Dir

RobertoS

Member
Licensed User
Longtime User
Hi,
I have a strange problem with files in DirAssets and B4A 9.x

When I build in Debug mode the files are copied in the apk and everything works, but if I build in release mode (obfuscated or not) the files are not copied, and the app crashes.

Everything works ok if I use a B4A version 8.

I upload a simple project.

And this is the log of app.

*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
main_activity_create (java line: 344)
java.io.FileNotFoundException: test.jpg
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:316)
at android.content.res.AssetManager.open(AssetManager.java:290)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:207)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
at b4a.example.main._activity_create(main.java:344)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at b4a.example.main.afterFirstLayout(main.java:104)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5019)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)


Thank's

Roberto
 

Attachments

  • test9.zip
    5.1 KB · Views: 161
Top