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

Discussion in 'Android Questions' started by Phil Thompson, Jun 20, 2019.

  1. Phil Thompson

    Phil Thompson Member Licensed 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: Jun 20, 2019
  2. emexes

    emexes Well-Known Member 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
     
  3. sorex

    sorex Expert Licensed 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.
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    This error is related to old build tools. Download the ready to run sdk and configure the IDE to use it.
     
  5. Phil Thompson

    Phil Thompson Member Licensed 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.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    Download the "ready to run" sdk. It is simpler to start with it.
     
  7. Phil Thompson

    Phil Thompson Member Licensed User

  8. Phil Thompson

    Phil Thompson Member Licensed 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
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Ignore this error. Have you configured the IDE to use the correct SDK (Tools - Configure Paths)?
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice