Android Question When add Crashlytics function, can't build the project.

tzfpg

Active Member
Licensed User
Longtime User
i follow the instruction this link https://www.b4x.com/android/forum/threads/crashlytics-crash-reports.87510/#content

main:
B4X:
#AdditionalJar: com.google.firebase:firebase-crashlytics

manifest editor:
B4X:
CreateResourceFromFile(Macro, FirebaseAnalytics.GooglePlayBase)
CreateResourceFromFile(Macro, FirebaseAnalytics.Firebase)
CreateResourceFromFile(Macro, FirebaseNotifications.FirebaseNotifications)
CreateResourceFromFile(Macro, FirebaseAnalytics.FirebaseAnalytics)
CreateResourceFromFile(Macro, FirebaseAnalytics.Crashlytics)

when i build the project, i got the error message:

B4X:
B4A Version: 10.2
Java Version: 11
Parsing code.    (0.21s)
Building folders structure.    (0.02s)
Running custom action.    (1.07s)
Compiling code.    (0.28s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
    (AndroidX SDK)
Generating R file.    (1.18s)
Compiling debugger engine code.    (3.51s)
Compiling generated Java code.    (4.73s)
Convert byte code - optimized dex.    Error
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/DataEncoder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/Encoder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/EncodingException;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/ObjectEncoder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/ObjectEncoderContext;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/ValueEncoder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/ValueEncoderContext;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/config/Configurator;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/encoders/config/EncoderConfig;
9 errors; aborting

if i delete the main AdditionalJar: com.google.firebase:firebase-crashlytics
i can built without error.

please help me check where i make mistake.
thank you.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…