Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

class file for com.google.android.gms.internal.zzbej not found #2317

Open
lsantaniello opened this issue Apr 14, 2018 · 17 comments
Open

class file for com.google.android.gms.internal.zzbej not found #2317

lsantaniello opened this issue Apr 14, 2018 · 17 comments

Comments

@lsantaniello
Copy link

lsantaniello commented Apr 14, 2018

Expected Behaviour

The application crashes immediately after the splash screen.

Platform and Version (eg. Android 5.0 or iOS 9.2.1)

cli packages: (C:\Users\lsantaniello\AppData\Roaming\npm\node_modules)
    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:
    cordova (Cordova CLI) : not installed

local packages:
    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.1.0 browser 5.0.3 ios 4.5.4
    Ionic Framework    : ionic-angular 3.9.2

System:
    Node : v8.9.4
    npm  : 5.6.0
    OS   : Windows 10

Environment Variables:
    ANDROID_HOME : not set

Misc:
    backend : pro

Plugin version

phonegap-plugin-push 2.2.2 "PushPlugin"

Logs taken while reproducing problem

* Where:
Script 'C:\myapp\platforms\android\phonegap-plugin-push\weareenergy-push.gradle' line: 35

* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [class 'com.google.gms.googleservices.GoogleServicesPlugin']
   > For input string: "+"
@lsantaniello
Copy link
Author

I tried to modify android.properties...

old

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-fabric-plugin/weareenergy-build-extras.gradle
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.google.android.gms:play-services-analytics:+
cordova.system.library.4=com.android.support:support-v13:27.+
cordova.system.library.5=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.6=com.google.firebase:firebase-messaging:11.6.2
cordova.gradle.include.2=phonegap-plugin-push/weareenergy-push.gradle
cordova.gradle.include.3=cordova-android-play-services-gradle-release/weareenergy-cordova-android-play-services-gradle-release.gradle

I changed com.google.android.gms:play-services-analytics:11.6.2

target=android-27
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.gradle.include.1=cordova-fabric-plugin/weareenergy-build-extras.gradle
cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0
cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.3=com.google.android.gms:play-services-analytics:11.6.2
cordova.system.library.4=com.android.support:support-v13:27.+
cordova.system.library.5=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.6=com.google.firebase:firebase-messaging:11.6.2
cordova.gradle.include.2=phonegap-plugin-push/weareenergy-push.gradle
cordova.gradle.include.3=cordova-android-play-services-gradle-release/weareenergy-cordova-android-play-services-gradle-release.gradle

but now I have this error:

C:\myapp\platforms\android\app\src\main\java\com\adobe\phonegap\push\FCMService.java:74: error: cannot access zzbej
    String from = message.getFrom();
                         ^
  class file for com.google.android.gms.internal.zzbej not found
Note: Some input files use or override a deprecated API.
 FAILED

@lsantaniello lsantaniello changed the title Build Error: com.google.gms.googleservices.GoogleServicesPlugin class file for com.google.android.gms.internal.zzbej not found Apr 14, 2018
@jacquesdev
Copy link
Contributor

Been having this problem since yesterday. Thought it was the older version of the plugin (I was using 1.10.7, and tried upgrading to 1.11.0) but had the same issue. I was in the process of upgrading to 2.2.2, since I assumed that this problem would be solved there - but since it's not I am going to wait a bit longer.

@lsantaniello
Copy link
Author

I don't understand. Could you please support me?

@macdonst
Copy link
Member

@lsantaniello yeah, this is a duplicate of #1718. Sadly the way Android dependencies have evolved and the Cordova plugin ecosystem includes shared libraries we run into a lot of these problems. You are doing the right thing by matching your play services and fcm versions.

With your latest build error I'd look at cleaning out the android platform completely, then making sure all your android dependencies are up to date, then trying a re-build.

@Ross-Rawlins
Copy link

I followed all these steps but the issue persists is there perhaps a newer solution?

@ef1x
Copy link

ef1x commented Apr 27, 2018

@Ross-Rawlins I can fix my build by changing cordova.system.library.11=com.google.firebase:firebase-messaging: to 12.0.0 in the project.properties.

All my play-services are running on google-play-service version 12.0.0.

Themes like they removed message.getFrom in the higher releases.

@macdonst
Copy link
Member

@efix0 no the getFrom method is still in RemoteMessage: https://developers.google.com/android/reference/com/google/firebase/messaging/RemoteMessage.html#getFrom()

@lsantaniello looking at your dependencies:

cordova.system.library.2=com.android.support:support-v4:24.1.1+
cordova.system.library.4=com.android.support:support-v13:27.+

Both of the support libraries should be the same version.

@AlbertoGomezMartin
Copy link

Same issue here.

I have the following message when I try to build:

platforms/android/src/com/adobe/phonegap/push/FCMService.java:74: error: cannot access zzbej
    String from = message.getFrom();
                         ^
  class file for com.google.android.gms.internal.zzbej not found

My android.properties is like this:

target=android-26 android.library.reference.1=CordovaLib cordova.gradle.include.1=cordova-android-play-services-gradle-release/egnosapp-cordova-android-play-services-gradle-release.gradle cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0 cordova.system.library.2=com.android.support:support-v4:24.1.1+ cordova.system.library.3=com.android.support:support-v4:26.+ cordova.system.library.4=com.android.support:appcompat-v7:26.+ cordova.system.library.5=com.android.support:support-v13:26.+ cordova.system.library.6=me.leolin:ShortcutBadger:1.1.17@aar cordova.system.library.7=com.google.firebase:firebase-messaging:11.6.2 cordova.gradle.include.2=phonegap-plugin-push/egnosapp-push.gradle

My plugin version is 2.1.2

@macdonst
Copy link
Member

@AlbertoGomezMartin yeah, as you can see in the android.properties two different plugins add v4 support libs at different API levels. That's going to cause a problem. What plugins are you using?

@AlbertoGomezMartin
Copy link

AlbertoGomezMartin commented May 14, 2018

Hi @macdonst
My plugin list is as follows:

com.lampa.startapp 0.1.4 "startApp"
cordova-android-play-services-gradle-release 1.4.1 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"
cordova-custom-config 3.0.14 "cordova-custom-config"
cordova-open 1.0.12 "Open"
cordova-plugin-advanced-http 1.11.0 "Advanced HTTP plugin"
cordova-plugin-app-version 0.1.9 "AppVersion"
cordova-plugin-device 1.1.7 "Device"
cordova-plugin-file 6.0.1 "File"
cordova-plugin-file-transfer 1.7.1 "File Transfer"
cordova-plugin-geolocation 3.0.0 "Geolocation"
cordova-plugin-globalization 1.0.8 "Globalization"
cordova-plugin-inappbrowser 2.0.2 "InAppBrowser"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.1 "cordova-plugin-ionic-webview"
cordova-plugin-network-information 1.3.4 "Network Information"
cordova-plugin-screen-orientation 3.0.1 "Screen Orientation"
cordova-plugin-splashscreen 4.1.0 "Splashscreen"
cordova-plugin-statusbar 2.4.1 "StatusBar"
cordova-plugin-whitelist 1.3.3 "Whitelist"
cordova-plugin-wkwebview-engine 1.1.4 "Cordova WKWebView Engine"
cordova.plugins.diagnostic 4.0.5 "Diagnostic"
es6-promise-plugin 4.2.2 "Promise"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.1.3 "PushPlugin"

I just removed the 'cordova-plugin-camera' that included the 'com.android.support:support-v4:24.1.1+ ' library (I don't need access to camera),

So my android.properties updated is
target=android-26 cordova.gradle.include.1=cordova-android-support-gradle-release/egnosapp-cordova-android-support-gradle-release.gradle cordova.system.library.1=com.squareup.okhttp3:okhttp-urlconnection:3.10.0 cordova.system.library.2=com.android.support:support-v4:26.+ cordova.system.library.3=com.android.support:appcompat-v7:26.+ cordova.system.library.4=com.android.support:support-v13:26.+ cordova.gradle.include.2=cordova-android-play-services-gradle-release/egnosapp-cordova-android-play-services-gradle-release.gradle android.library.reference.1=CordovaLib cordova.system.library.5=me.leolin:ShortcutBadger:1.1.17@aar cordova.system.library.6=com.google.firebase:firebase-messaging:11.6.2 cordova.gradle.include.3=phonegap-plugin-push/egnosapp-push.gradle

And it is still showing the following when trying to build in Android (btw, in ios it works perfectly)

platforms/android/src/com/adobe/phonegap/push/FCMService.java:74: error: cannot access zzbej
    String from = message.getFrom();
                         ^
  class file for com.google.android.gms.internal.zzbej not found
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.
1 error

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileDebugJavaWithJavac'.

Any help would be really appreciated

@AlbertoGomezMartin
Copy link

To whom it may concern, I uninstall these plugins and the error dissapeared:

cordova-android-play-services-gradle-release 1.4.1 "cordova-android-play-services-gradle-release"
cordova-android-support-gradle-release 1.4.2 "cordova-android-support-gradle-release"

👍

@dpa99c
Copy link

dpa99c commented May 17, 2018

FYI, cordova-android-play-services-gradle-release can be used in conjunction with the newly created cordova-android-firebase-gradle-release to resolve build issues where another plugin in the project specifies a different version of the Play Services and/or Firebase libraries.

For example:

cordova create test && cd test
cordova platform add [email protected]
cp /some/path/to/google-services.json platforms/android/app/
cordova plugin add [email protected]
cordova plugin add [email protected]
cordova build android
> :app:compileDebugJavaWithJavacD:\Temp\test\platforms\android\app\src\main\java\com\adobe\phonegap\push\FCMService.java:74: error: cannot access zzbej
>    String from = message.getFrom();
>                         ^
>  class file for com.google.android.gms.internal.zzbej not found
> FAILURE: Build failed with an exception.

😢

cordova plugin add cordova-android-play-services-gradle-release  --variable PLAY_SERVICES_VERSION=15.+
cordova plugin add cordova-android-firebase-gradle-release  --variable FIREBASE_VERSION=15.+
cordova build android
> BUILD SUCCESSFUL

😎

See dpa99c/cordova-plugin-request-location-accuracy#50

@itslenny
Copy link

itslenny commented Dec 21, 2018

@dpa99c This got me closer (I think), but now I'm getting this new error

The library com.google.android.gms:play-services-measurement-base is being requested
by various other libraries at [[15.0.2,15.0.2]], but resolves to 15.0.4.

Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies

I tried specifying 15.0.2 (instead of 15.+), but then I get an error that that version of the plugin doesn't exist. 😭

Any ideas?

@awadhajj
Copy link

@itslenny : have u fixed this? am facing it and tried many many solutions uselessly :(

@kapilSoni101
Copy link

kapilSoni101 commented May 27, 2019

@dpa99c: Sir i have installed both command but i got below error:

  • What went wrong:
    The library com.google.android.gms:play-services-measurement-base is being requested by various other libraries at [[15.0.2,15.0.2]], but resolves to 15.0.4. Disable the plugin and check your dependencies tree using ./gradlew :app:dependencies.

@damoeb
Copy link

damoeb commented Aug 26, 2019

I fixed it by specifying the firebase version FCM_VERSION when adding the plugin.
cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.1.0

@vicbob
Copy link

vicbob commented Oct 10, 2019

I fixed it by specifying the firebase version FCM_VERSION when adding the plugin.
cordova plugin add phonegap-plugin-push --variable FCM_VERSION=17.1.0

This solved my issue too. Thanks.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests