Java Question R.txt file missing when include an external jar with its own activity

Discussion in 'Libraries developers questions' started by abilio486software, Jul 12, 2019.

  1. abilio486software

    abilio486software Member Licensed User

    When I try to call a java library function, at runtime I get this error:

    "Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mypos.slavesdk.R$layout" on path: DexPathList[[zip file "/data/app/b4a.example-OuVR1rV5D6tcq-douDcfTQ==/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-OuVR1rV5D6tcq-douDcfTQ==/lib/arm64, /system/lib64, /vendor/lib64]]"

    Library is trying to open its own connection activity.

    .jar library was extracted from the .aar where exists the R.txt

    In fact I didn't copy the R.txt file, only the res folder and the jar class.

    Is this error happening because it's missing the library R.txt ?

    Any strategy to bypass this error?
     

    Attached Files:

  2. abilio486software

    abilio486software Member Licensed User

    Anyone has a strategy to bypass this error?
     
  3. DonManfred

    DonManfred Expert Licensed User

    Can you post a link to the original lib (maybe where one can found a example in java)?
     
    Peter Simpson likes this.
  4. DonManfred

    DonManfred Expert Licensed User

    It is because you are only referencing the classes.jar which is a mistake. The classes.jar is only needed when buiding a library with java.

    In b4a you should always reference the original aar.
     
    abilio486software likes this.
  5. abilio486software

    abilio486software Member Licensed User

    Ok, But when I use the .aar, I get this error.

    Inside the .aar, two lines from the res "values.xml" causes the error.

    What could be missing?
     

    Attached Files:

  6. abilio486software

    abilio486software Member Licensed User


    Hi,

    I have builded from scratch an Android studio project and when I include the .aar library I get the same error.

    I will talk with MyPOS Delvelopment team.

    It seems that this is not related with B4A but an error inside the .aar library.

    Thanks
     

    Attached Files:

    Last edited: Jul 13, 2019
  7. abilio486software

    abilio486software Member Licensed User

    Solved!

    Missing resources requested from .aar library quickly solved with adicion of:

    compile 'com.android.support:appcompat-v7:25.0.1'
    compile 'com.android.support:design:25.0.1'
    compile 'com.android.support:support-v4:25.0.1'
    compile 'com.android.support:gridlayout-v7:25.0.1'
    compile 'com.android.support:cardview-v7:25.0.1'

    Many thanks!
    Abilio
     
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