Android Question Type com.google.firebase.encoders.DataEncoder is defined multiple times: error while trying to run document scanner demo.

MrKim

Well-Known Member
Licensed User
Longtime User
I am trying to compile document scanner and get the following error aafter downloading the required files using SDK Manager.

B4X:
Dex code    (0.76s)
Dex merge    Error
Error in c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-encoders-json\16.1.0\unpacked-firebase-encoders-json-16.1.0\jars\classes.zip:classes.dex:
Type com.google.firebase.encoders.DataEncoder is defined multiple times: c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-encoders-json\16.1.0\unpacked-firebase-encoders-json-16.1.0\jars\classes.zip:classes.dex, c:\android\tools\..\extras\b4a_remote\com\google\firebase\firebase-encoders\17.0.0\firebase-encoders-17.0.0.zip:classes.dex
Compilation failed
I would just delete what I assume is the older one (16.1.0) but I found one post with a similar error HERE. And the solution there was to exclude one lib and add a couple of others. I am also concerned that the other might be used by some other program.
I did spend an hour taking several stabs at excluding one or the other of the libs by trying to guess the appropriate name based on the error but had no luck.
I also tried alternately renaming the paths to each of the duplicates but that just got me the compile error that the item could not be found.
I also noticed that the original document scanner post had:
B4X:
#AdditionalJar: com.google.android.gms:play-services-mlkit-document-scanner
#AdditionalJar: kotlin-stdlib-1.6.10
#AdditionalJar: androidx.arch.core:core-runtime
but the example had only:
B4X:
#AdditionalJar: com.google.android.gms:play-services-mlkit-document-scanner
#MultiDex: True
I mention this in case it has something to do with the problem but I am assuming the updated example no longer needs these.
Thanks for any help.

PS: If someone understands what is going on here I would also very much appreciate an explanation in addition to a solution, thanks.
 

MrKim

Well-Known Member
Licensed User
Longtime User
I did as (I hope) instructed. I replaced C:\Android\extras with the files in extras.7z and now NONE of my Android apps compile.
This includes the document scanner example - unchanged.
I get the following error:
B4X:
Building folders structure.    (2.04s)
Running custom action.    (0.07s)
Compiling code.    (1.07s)
Compiling layouts code.    (0.13s)
Organizing libraries.    (0.17s)
    (AndroidX SDK)
Compiling resources    (3.77s)
Linking resources    Error
c:\android\tools\..\extras\b4a_remote\androidx\core\core\1.13.1\unpacked-core-1.13.1\res\values\values.xml:121: error: resource android:attr/lStar not found.
error: failed linking references.
My OLD extras folder contained a folder dated 2023 called intel. I tried copying that to the NEW extras folder but it made no difference.
After looking at another post on this I looked at my libs. I am using B4a 13.1 and the only thing out of date is XUI Views - 260 vs 2.66.
 
Last edited:
Upvote 0
Top