Android Question B4A. Load from DirAsset error

Discussion in 'Android Questions' started by ZJP, Nov 7, 2019.

  1. ZJP

    ZJP Active Member Licensed User

    Hi,

    Just upgrade to the latest version (9.50) from the 6.50.

    I have now an error "An error has occured in sub:main_activity_create (java line: 474). java.io.FileNotFoundException: marker_oranged.png".

    in this line
    Code:
    Dim tmp1 As Bitmap = LoadBitmap(File.DirAssets, "marker_oranged.png")
    The file is (of course) present in the File Manager.

    I have this error with every LoadFromAssets to.

    Any solution?
    Thanks
     
  2. LucaMs

    LucaMs Expert Licensed User

    Did you try CTR+P = Clean Project?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    If cleaning the project doesn't solve it then try to uninstall the app from the device, clean the project and run again.
     
  4. ZJP

    ZJP Active Member Licensed User

    Hi,
    I have trying anything both of you have suggested. Even changing the device. The error still present.
    Back to the 6.50 for this project, and i will use the 9.50 for the next one.

    Thanks.
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    There is never a good reason to use an old version of B4A. Specifically not v6.50.

    1. Post the full error message.
    2. Open the APK with 7zip or a similar tool and check whether the file is there.
    3. Make sure that the file case in the APK is lower cased.
     
  6. ZJP

    ZJP Active Member Licensed User

    Hi,

    The 'assets' folder is not present in the 'v950 apk'. :confused:
     

    Attached Files:

  7. Erel

    Erel Administrator Staff Member Licensed User

    The answer is: you are using an old version of Android SDK. The old build tools cannot manage multiple assets folders and the files are then missing.

    The solution is to use B4A Sdk manager with the required components: https://www.b4x.com/b4a.html
     
  8. ZJP

    ZJP Active Member Licensed User

    Hi,

    Thanks a lot Erel. Problem solved. ;)
     
    Erel likes this.
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