Cordova-plugin-firebase: Build error for android

Created on 20 Aug 2018  ·  5Comments  ·  Source: arnesson/cordova-plugin-firebase

Cordova 7.0.1
[email protected]

I needed to upgrade my app from [email protected] to @6.3 - during the rebuild I am add a plugin, recompile, verify errors or warnings, then go on to next plugin.

With about 30 plugins successfully installed, I start to get to the ones that require specific versions of Android-SDKs and play-services version.

I install these first:

cordova plugin add cordova-android-play-services-gradle-release  --variable PLAY_SERVICES_VERSION=15.+  //REM (ver 1.4.3)
cordova plugin add cordova-android-support-gradle-release //REM (ver 1.4.4)

Next I install the following and get warnings, but it still compiles successfully:
cordova plugin add cordova-plugin-request-location-accuracy //REM 2.2.3
Compile Warnings:

C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\15.0.1\jars\classes.jar(com/google/android/gms/common/api/GoogleApiClient.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy': class file for javax.annotation.concurrent.GuardedBy not found

Finally, I install cordova-plugin-firebase (v1.0.5) and get the following warnings which cause the build to fail:

C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-common\16.0.1\jars\classes.jar(com/google/firebase/FirebaseApp.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-iid\17.0.0\jars\classes.jar(com/google/firebase/iid/FirebaseInstanceId.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-iid\17.0.0\jars\classes.jar(com/google/firebase/iid/FirebaseInstanceId.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-config\16.0.0\jars\classes.jar(com/google/firebase/remoteconfig/FirebaseRemoteConfig.class): warning: Cannot find annotation method 'value()' in type 'GuardedBy'
C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-crash\16.0.1\jars\classes.jar(com/google/firebase/crash/FirebaseCrash.class): warning: Cannot find annotation method 'value()' in type 'UsedByReflection': class file for com.google.android.apps.common.proguard.UsedByReflection not found
C:\Users\RPO\dev\Whipster_0.2.5\platforms\android\build\intermediates\exploded-aar\com.google.firebase\firebase-crash\16.0.1\jars\classes.jar(com/google/firebase/crash/FirebaseCrash.class): warning: Cannot find annotation method 'value()' in type 'UsedByReflection'
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
7 warnings

And then the build fails on:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/internal/measurement/zzkt;
build android

All 5 comments

I tried cordova clean but it did not help. Project stuck until this firebase issue is resolved.

@rolinger try installing the new plugin cordova-android-firebase-gradle-release as mentioned in the README

Closing as fixed per the updated instructions in the README. Please reopen if this issue persists with the latest version after following those instructions.

I was finally able to get everything installed with Cordova 8.0 and cordova-android 7.1.1 using cordova-plugin-firebase 1.0.5

FYI, I was getting this issue until I realized that I was using version 6.3.0 of the cordova android platform, and this plugin currently supports 6.4.0 and up. Once I upgraded, it worked fine.

Was this page helpful?
0 / 5 - 0 ratings