Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: cannot access zzbfm / class file for com.google.android.gms.internal.zzbfm not found - Ionic 6 #831

Closed
2 of 3 tasks
seltix5 opened this issue Dec 13, 2022 · 5 comments

Comments

@seltix5
Copy link

seltix5 commented Dec 13, 2022

What happened?

Incompatible with the background geolocation plugin npm install cordova-background-geolocation-plugin.
Both plugins work when running separatly but when installed at the same time it does not compile.

Steps to reproduce?

( this is using Ionic 6 )

ionic start TEST --type angular --package-id=com.test.app blank
cd TEST

ionic cap add android


npm install cordova-background-geolocation-plugin

// apply this fix required for ionic 6 : https://github.com/HaylLtd/cordova-background-geolocation-plugin/issues/122#issuecomment-1271553737
// in android/app/src/main/res/values/strings.xml, add the following:
//   <string name="plugin_bgloc_account_name">@string/app_name</string>
//   <string name="plugin_bgloc_content_authority">$PACKAGE_NAME</string>
//   <string name="plugin_bgloc_account_type">$PACKAGE_NAME.account</string>


// compile test before installing second plugin
ionic cap sync && cd android && gradlew assembleDebug && cd ..


npm install onesignal-cordova-plugin


// compile test
ionic cap sync && cd android && gradlew assembleDebug && cd ..
// or open on android studio with:
ionic cap sync && ionic capacitor run android -l --external

What did you expect to happen?

to compile =)

OneSignal Cordova SDK version

[email protected]

Which platform(s) are affected?

  • iOS
  • Android

Relevant log output

\android\capacitor-cordova-android-plugins\src\main\java\com\marianhello\bgloc\data\BackgroundActivity.java:20: error: cannot access zzbfm
        confidence = activity.getConfidence();
                             ^
  class file for com.google.android.gms.internal.zzbfm not found

image

Code of Conduct

  • I agree to follow this project's Code of Conduct
@jkasten2
Copy link
Member

@seltix5 Thanks for reporting, can you confirm you are using the latest version of each SDK (cordova-background-geolocation-plugin and onesignal-cordova-plugin)?

The build error is coming from com.marianhello.bgloc.data. It looks like others are running into this same problem even without OneSignal.
mauron85/background-geolocation-android#40

@seltix5
Copy link
Author

seltix5 commented Dec 13, 2022

hello
this is a fresh new project for testing so yes, it should be the latest one:

    "cordova-background-geolocation-plugin": "^2.0.7",
    "onesignal-cordova-plugin": "^3.3.0",
> npm list
...
+-- [email protected]
+-- [email protected]
....

The background geolocation plugin is this one https://github.com/HaylLtd/cordova-background-geolocation-plugin but it is based on https://github.com/mauron85/cordova-plugin-background-geolocation thus the problem may be the same.

I already try to to install cordova-android-play-services-gradle-release as sugested but it did not help.
I even created the same issue on the other plugin at HaylLtd/cordova-background-geolocation-plugin#128 but the sugested solution did not work either.
Sadly I have no knowlage to try to find the problem myself and I dont know what else I can do.
As described on that issue discution I already created an new project to confirm that separatly both plugins work, only when both are installed at the same time I have the compilation error...
Any help is apreciated.
Thank you.

@seltix5
Copy link
Author

seltix5 commented Dec 14, 2022

I just updated the original post with the exact steps to create the project from zero.

@seltix5
Copy link
Author

seltix5 commented Feb 23, 2023

hello! any updates on this?

@seltix5
Copy link
Author

seltix5 commented Feb 27, 2023

I finally fixed the problem changing the default GOOGLE_PLAY_SERVICES_VERSION from 11+ to 15+ here :
https://github.com/HaylLtd/cordova-background-geolocation-plugin/blob/033ee47d8473f568068a2161bed0350fa571f3c5/plugin.xml#L27
Thank you

@seltix5 seltix5 closed this as completed Feb 27, 2023
phablulo added a commit to phablulo/cordova-background-geolocation-plugin that referenced this issue Mar 2, 2024
Fix problems with com.google.android.gms.internal.zzbfm
from OneSignal/OneSignal-Cordova-SDK#831 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants