Android Question Layout File not found in Release Mode - OK in Debug

Phil Thompson

Member
Licensed User
Longtime User
B4a V9.01.2
c:\android\platforms\android-28\android.jar
updated all in SDKmanager
C:\Program Files\Java\jdk1.8.0_162\bin\javac.exe


I recently updated to 9.01.2 and a new Samsung A70( 2400x1080 pixels). Now I need to update all my apps for this new phone. In debug mode, the layout loads but only shows half the screen. However when I try to compile in release mode, I get an error. What have I missed?

java.io.FileNotFoundException: newphone.bal
at android.content.res.AssetManager.nativeOpenAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:796)
at android.content.res.AssetManager.open(AssetManager.java:773)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:207)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:82)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at pgt.prescriptions.main._activity_create(main.java:495)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:196)
at pgt.prescriptions.main.afterFirstLayout(main.java:104)
at pgt.prescriptions.main.access$000(main.java:17)
at pgt.prescriptions.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7089)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
java.io.FileNotFoundException: newphone.bal
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
 
Last edited:

emexes

Expert
Licensed User
The first things I'd try are:
1/ confirm that the file newphone.bal shows up in the Files Manager tab
2/ check that file name newphone.bal very carefully
2/ make sure that you don't have source files open in any other programs or windows
3/ Tools menu, Clean Project
4/ delete the app from the phone, to force fresh full reinstall
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
did you press the sync button in the file tab?

sometimes it shows things that aren't there anymore and the debug version might still have the file on the device.
 
Upvote 0

Phil Thompson

Member
Licensed User
Longtime User
I thought I had the the new build tools. I downloaded the sdk, installed it and configured the IDE to use
c:\android\platforms\android-28\android.jar as indicated above. Did I miss something here?

Step 4 in the list above is the only step not yet done. I have been upgrading in the same location for many years. I guess its time to blow it all away and create a fresh install.
 
Upvote 0

Phil Thompson

Member
Licensed User
Longtime User
On extracting the android-sdk-windows.zip\, I get the following error. Didn't take note of this on the original extraction. upload_2019-6-20_13-2-34.png

upload_2019-6-20_13-2-34.png
 
Upvote 0
Top