Java Question Dificult using an external .aar library

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

Tags:
  1. abilio486software

    abilio486software Member Licensed User

    Hello,

    I'm trying to integrate a MyPOS terminal payment SDK without success.

    At this moment I'm getting a compile error when include the .aar library:

    "Generating R file. Error
    C:\Android\tools\..\extras\b4a_local\unpacked-slavesdk-release-63698443706298\res\values\values.xml:137: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.NoActionBar'.
    C:\Android\tools\..\extras\b4a_local\unpacked-slavesdk-release-63698443706298\res\values\values.xml:140: error: Error: No resource found that matches the given name: attr 'colorAccent'."

    I include the simple project hopping to get your precious help :)

    What I'm doing wrong?

    Many thanks
     

    Attached Files:

  2. DonManfred

    DonManfred Expert Licensed User

    1. Developerquestions should be posted in the java questions forum
    2. Add Appcompat to your app (based on the error you are not using it).
    3. You are missing all the needed permissions for the AAR
    4. You are missing RuntimePermissions and the Requests for all the needed Permissions.
    5. You are missing the additional Activities which are defined in the AAR.
    6. The correct way to export a Project is to use File-Export as ZIP.
     
    Last edited: Jul 11, 2019
    Erel and abilio486software like this.
  3. abilio486software

    abilio486software Member Licensed User


    Hi,

    May thanks!

    Sorry but don't find specific Java forum for B4A.

    For some reason I'm still getting this two errors:

    C:\Android\tools\..\extras\b4a_local\unpacked-slavesdk-release-63698443706298\res\values\values.xml:147: error: Error: No resource found that matches the given name: attr 'layout_columnWeight'.
    C:\Android\tools\..\extras\b4a_local\unpacked-slavesdk-release-63698443706298\res\values\values.xml:146: error: Error: No resource found that matches the given name: attr 'layout_rowWeight'.


    Probably I'm doing something wrong.

    Could you take a look in the updated project attached?

    Thanks again :)
     

    Attached Files:

  4. DonManfred

    DonManfred Expert Licensed User

    abilio486software likes this.
  5. abilio486software

    abilio486software Member Licensed User

    I tryed these steps:

    - instead of using the .aar, I have unzip it and use the classes.jar
    - Move the library res folder to AditionalRes;
    - Change the res/values.xls, changing those two xml layour parameters

    Example now compile without errors.

    But when I try to connect to the terminal, 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]]"

    I think that the library is trying to open its own connection activity.

    In fact I didn't copy the R.txt file.

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

    Any strategy to bypass this error?
     

    Attached Files:

  6. DonManfred

    DonManfred Expert Licensed User

    You should start a new thread for any new question/issue.
     
  7. abilio486software

    abilio486software Member Licensed User

    Solved!

    It was necessary to compile with these parameters:

    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