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

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?
 

Attachments

DonManfred

Expert
Licensed User
Is this error happening because it's missing the library R.txt ?
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

Member
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.
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?
 

Attachments

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?

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
 

Attachments

Last edited:

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
 
Top