When I use the ionic-native google-maps plugin it gives the error class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found
When running ionic run android:
Error: /ionic-app/platforms/android/gradlew: Command failed with exit code 1 Error output:
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
/ionic-app/platforms/android/src/plugin/google/maps/PluginUtil.java:135: error: cannot access AbstractSafeParcelable
Builder builder = LatLngBounds.builder();
^
class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable 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'.
> Compilation failed; see the compiler error output for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
My system:
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.4-201612220408
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 0.0.48
ios-deploy version: Not installed
ios-sim version: 5.0.13
OS: OS X El Capitan
Node Version: v7.2.0
Xcode version: Xcode 8.2.1 Build version 8C1002
I found this on stackoverflow: http://stackoverflow.com/questions/41030573/ionic-v2-google-maps-api-android-build-error-cannot-access-abstractsafeparcelab
But I think it should work without tinkering inside the platforms folder.
+1; any solution?
I had the same problem, but I use the plugin normally because it seems that this problem happen only with version 1.4 of the plugin.
You can try:
$ ionic plugin rm cordova-plugin-googlemaps
$ ionic plugin add [email protected] --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE"
It isn't a solutions, but it'll help you to use the plugin. It worked for me until the moment.
Hi,
What is happening is not loading latest google play service and support. So, my fix is that I changed:
cordova.system.library.3=com.google.android.gms:play-services-location:9.8.0
cordova.system.library.4=com.android.support:support-v4:9.8.0
On project.properties file to:
cordova.system.library.3=com.google.android.gms:play-services-location:+
cordova.system.library.4=com.android.support:support-v4:+
If it doesn't work, also change this two guys:
cordova.system.library.1=com.google.android.gms:play-services-maps:+
cordova.system.library.2=com.google.android.gms:play-services-location:+
I hope that helps :)
+1; any solution?
Yes @jumong, updates android SDK and do as @hecomp said
I've been switching to https://github.com/SebastianM/angular2-google-maps/ worked like a charm :)
@basvdijk which are the advantages of switching? Is clustering supported?
PS: sorry for offtopic.
@basvdijk that works for angular2 only or also angular1?
@ZiFFeL1992 Advantage was it worked without any problems while the native one had problems at the time of early betas. I stuck to it (just need to show a map with a marker).
@braianj Since it is named angular2-google-maps I am sure it works only for Angular2+
@hecomp worked for me, why is this happening?
@leandroz that is because when you ':+' it looks for the latests services and location versions. But you need to have from version 9.8.0 to +
Hi every body, I face the same issues, but all solution here is not working, I am using ionic 2
I'm facing the same probl猫me.
Using Ionic2. Arrives only when I use the cordova-plugin-firebase (https://github.com/arnesson/cordova-plugin-firebase).
Seems to be solved using version 1.3.9 of this plugin.
I have the same exact problem when push notifications installed.
Also install Android SDK version 23.
I have upgraded to lower google map version & it works.
cordova plugin add [email protected] --variable API_KEY_FOR_ANDROID="XXX" --variable API_KEY_FOR_IOS="XXX"
Using 1.3.9 works for android.
But when using 1.3.9 we run into the same error for ios described in https://github.com/mapsplugin/cordova-plugin-googlemaps/issues/1062 where the solution is to update to 1.4.0, fixing ios but breaking android again.
I surely don't want to modify project.properties or any other files under platforms or plugins.
These folders are generated by ionic/cordova and are - according to best practices found on the internet - folders which should not be commited. This is why ionic uses "--save" when adding platforms.
I also remember the chaotic time when we commited these folders because it simply did not work as expected for multiple developers with multiple OSes because there are even absolute paths in some xmls/jsons.
Is there any other real solution which is not hacky like to modify automatically generated files or to remove and add the version before every build?
CHANGE
cordova.system.library.3=com.google.firebase:firebase-messaging:11.0.1
cordova.system.library.4=com.google.android.gms:play-services-ads:+
TO
cordova.system.library.3=com.google.firebase:firebase-messaging:11.+
cordova.system.library.4=com.google.android.gms:play-services-ads:11.+
setting project.proparties like :
target=android-26
android.library.reference.1=CordovaLib
android.library.reference.2=app
cordova.system.library.1=com.google.android.gms:play-services-maps:11.+
cordova.system.library.2=com.google.android.gms:play-services-location:11.+
cordova.gradle.include.1=phonegap-plugin-barcodescanner/campus-barcodescanner.gradle
cordova.system.library.3=com.android.support:support-v13:26.+
cordova.system.library.4=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.5=com.google.firebase:firebase-messaging:11.+
cordova.gradle.include.2=phonegap-plugin-push/campus-push.gradle
work for me :+1:
For the people who face this error, here is the trouble shooting guide.
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/troubleshootings/conflict_with_other_plugins/README.md
Hi,
What is happening is not loading latest google play service and support. So, my fix is that I changed:
cordova.system.library.3=com.google.android.gms:play-services-location:9.8.0 cordova.system.library.4=com.android.support:support-v4:9.8.0On project.properties file to:
cordova.system.library.3=com.google.android.gms:play-services-location:+ cordova.system.library.4=com.android.support:support-v4:+If it doesn't work, also change this two guys:
cordova.system.library.1=com.google.android.gms:play-services-maps:+ cordova.system.library.2=com.google.android.gms:play-services-location:+I hope that helps :)
not able to find project.properties file..
where do i have to make these changes?
cordova.system.library.1=com.google.android.gms:play-services-maps:+
cordova.system.library.2=com.google.android.gms:play-services-location:+
Most helpful comment
Hi,
What is happening is not loading latest google play service and support. So, my fix is that I changed:
On project.properties file to:
If it doesn't work, also change this two guys:
I hope that helps :)