Beta B4A 6B1: Trying to use Maven repository

corwin42

Expert
Licensed User
Longtime User
Hello,

I'm trying to use the maven repository with the old AppCompat Library, which references the android-support-v7-appcompat.jar

For this I removed the #AdditionalRes attributes which were used by the old library.
Instead I added
B4X:
#AdditionalJar: com.android.support:appcompat-v7
With my understanding, B4A should now use the maven repository and ignore the jar file.

This is the compile error I get:
B4A version: 6.00 BETA #1
Parsing code. (0.00s)
Compiling code. (0.70s)
Compiling layouts code. (0.05s)
Generating R file. (12.41s)
Compiling generated Java code. (4.43s)
Convert byte code - optimized dex. Error
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: Landroid/support/v7/text/AllCapsTransformationMethod;
at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)
at com.android.dx.dex.file.DexFile.add(DexFile.java:161)
at com.android.dx.command.dexer.Main.processClass(Main.java:615)
at com.android.dx.command.dexer.Main.processFileBytes(Main.java:570)
at com.android.dx.command.dexer.Main.access$2(Main.java:546)
at com.android.dx.command.dexer.Main$2.processFileBytes(Main.java:514)
at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
at com.android.dx.command.dexer.Main.processOne(Main.java:537)
at com.android.dx.command.dexer.Main.processAllFiles(Main.java:449)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:236)
at com.android.dx.command.dexer.Main.run(Main.java:206)
at com.android.dx.command.dexer.Main.main(Main.java:179)
at com.android.dx.command.Main.main(Main.java:103)
1 error; aborting
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
With my understanding, B4A should now use the maven repository and ignore the jar file.
Currently only the following "old" libraries are ignored:
google-play-services.jar
android-support-v4.jar

The best solution is to update the library and change the @DependsOn to com.android.support:appcompat-v7.
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
The best solution is to update the library and change the @DependsOn to com.android.support:appcompat-v7.

Ah, ok.

The problem is that there are some libraries now that depend on AppCompat. If you use more than one of them on one project, all have to be changed to the maven repositories.

I think a quick solution will be to change the xml files directly but I'm afraid there will be some confusion about this the next time.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
The problem is that there are some libraries now that depend on AppCompat. If you use more than one of them on one project, all have to be changed to the maven repositories.
Time to update the libraries i guess. And yes, i think i need to update some libs too ;-)
 
Upvote 0

corwin42

Expert
Licensed User
Longtime User
Which jars are currently referenced from those libraries? I will make the IDE handle it automatically.

I think the most important is:

android-support-v7-appcompat.jar

which corresponds to:

com.android.support:appcompat-v7
 
Upvote 0
Top