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

Crash on Android with AbstractMethodError abstract method "void com.google.android.gms.dynamic.zza.zza(com.google.android.gms.dynamic.zzo)" #1408

Closed
ethan605 opened this issue Jun 15, 2017 · 13 comments

Comments

@ethan605
Copy link

Hi, today I got this error when running react-native-maps on Android.

java.lang.AbstractMethodError: abstract method "void com.google.android.gms.dynamic.zza.zza(com.google.android.gms.dynamic.zzo)"
    at com.google.android.gms.dynamic.zza.zza
    at com.google.android.gms.dynamic.zza.onCreate
    at com.google.android.gms.maps.MapView.onCreate
    at com.airbnb.android.react.maps.AirMapView.<init>(AirMapView.java:129)
    at com.airbnb.android.react.maps.AirMapManager.createViewInstance(AirMapManager.java:62)
    at com.airbnb.android.react.maps.AirMapManager.createViewInstance(AirMapManager.java:29)
    at com.facebook.react.uimanager.ViewManager.createView(ViewManager.java:46)
    at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:218)
    at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:152)
    at com.facebook.react.uimanager.UIViewOperationQueue$2.run(UIViewOperationQueue.java:781)
    at com.facebook.react.uimanager.UIViewOperationQueue.flushPendingBatches(UIViewOperationQueue.java:843)
    at com.facebook.react.uimanager.UIViewOperationQueue.access$1600(UIViewOperationQueue.java:48)
    at com.facebook.react.uimanager.UIViewOperationQueue$3.runGuarded(UIViewOperationQueue.java:815)
    at com.facebook.react.bridge.GuardedRunnable.run(GuardedRunnable.java:21)
    at android.os.Handler.handleCallback(Handler.java:751)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:154)
    at android.app.ActivityThread.main(ActivityThread.java:6682)
    at java.lang.reflect.Method.invoke(Method.java)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)

Packages using in my project:

react@16.0.0-alpha.6
react-native@0.44.3
react-native-calendar-events@1.3.6
react-native-code-push@2.1.0-beta
react-native-device-info@0.10.2
react-native-fbsdk@0.6.0
react-native-fcm@6.2.3
react-native-fetch-blob@0.10.5
react-native-i18n@1.0.0
react-native-image-picker@0.26.3
react-native-linear-gradient@2.0.0
react-native-maps@0.15.2
react-native-sentry@0.12.11
react-native-spinkit@1.0.3
react-native-svg@5.1.8
react-native-vector-icons@4.2.0
react-native-youtube@1.0.0-alpha.4

android/build.gradle dependencies:

...
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.+'
        classpath 'com.google.gms:google-services:3.0.0'
    }
...

android/app/build.gradle dependencies:

dependencies {
    compile project(':react-native-image-picker')
    compile project(':react-native-svg')
    compile project(':react-native-i18n')
    compile project(':react-native-fcm')
    compile project(':react-native-fetch-blob')
    compile project(':react-native-calendar-events')
    compile project(':react-native-sentry')
    compile project(':react-native-youtube')
    compile project(':react-native-linear-gradient')
    compile project(':react-native-fbsdk')
    compile project(':react-native-spinkit')
    compile project(':react-native-vector-icons')
    compile project(':react-native-device-info')
    compile project(':react-native-code-push')
    compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile 'com.google.android.gms:play-services-base:10.+'
    compile 'com.google.android.gms:play-services-maps:10.+'
    compile 'com.google.firebase:firebase-core:10.+'
    compile fileTree(dir: "libs", include: ["*.jar"])
    compile "com.android.support:appcompat-v7:25.0.1"
    compile "com.facebook.react:react-native:+"  // From node_modules
}

...

apply plugin: 'com.google.gms.google-services'

Things are quite as same as #1051, #1077 and #1383 but non of these solutions worked for me. The map worked correctly before react-native-i18n, react-native-image-picker and react-native-svg` added. But I'm not sure if they're the reasons or not.

Anyone has faced this too?

@thupv
Copy link

thupv commented Jun 15, 2017

Same problem :(

@jcharbo
Copy link

jcharbo commented Jun 15, 2017

ditto

@JPig
Copy link

JPig commented Jun 15, 2017

+1

@JPig
Copy link

JPig commented Jun 16, 2017

updating to:

compile(project(':react-native-maps')) {
  exclude group: 'com.google.android.gms', module: 'play-services-base'
  exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
    
compile 'com.google.android.gms:play-services-base:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'

fixed the problem for me. give it a try.

@thupv
Copy link

thupv commented Jun 16, 2017

You can try update to

compile(project(':react-native-maps')) {
  exclude group: 'com.google.android.gms', module: 'play-services-base'
  exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
    
compile 'com.google.android.gms:play-services-base:11.+'
compile 'com.google.android.gms:play-services-maps:11.+'

worked for me

@ethan605
Copy link
Author

Confirmed that @JPig's solution works out of the box.
Thank you so much.

@Angelk90
Copy link

@ethan605, @JPig, @thupv:
\android\app\build.gradle
Add:
compile(project(':react-native-maps')) {
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}

compile 'com.google.android.gms:play-services-base:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'

But it does not work.
What can I do?

@cjadhav
Copy link

cjadhav commented Aug 10, 2017

Hi
I have done the following changes,
/android/app/build.gradle

Replace:
compile project(':react-native-maps')

With

    compile(project(':react-native-maps')) {
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    compile 'com.google.android.gms:play-services-base:11.+'
    compile 'com.google.android.gms:play-services-maps:11.+'
    compile 'com.google.android.gms:play-services-location:+'

Means extra dependancy on compile 'com.google.android.gms:play-services-location:+' needs to get it work.
This change solves my problem. 👍

I have tested in react-native: 0.42.3 with react-native-maps:0.13.0 on Nexus-6 with Android 7.0.

@3210jr
Copy link

3210jr commented Aug 15, 2017

The solution by @cjadhav saved me! I only had to make one change to the last compile statement from :
compile 'com.google.android.gms:play-services-location:+'
to :
compile 'com.google.android.gms:play-services-location:11.+'

This has been a great pain! Thanks @cjadhav !

@tavriaforever
Copy link

@cjadhav Thanks! Your solution works perfect.
react-native-maps@0.20.1
react-native@0.55.3

@vjsingh96
Copy link

updating to:

compile(project(':react-native-maps')) {
  exclude group: 'com.google.android.gms', module: 'play-services-base'
  exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
    
compile 'com.google.android.gms:play-services-base:11.0.0'
compile 'com.google.android.gms:play-services-maps:11.0.0'

fixed the problem for me. give it a try.

Not working in my case

@mh7777777
Copy link

Any solution for "react-native-maps": "0.26.1" and "react-native": "0.61.5" ?

@bevishwas
Copy link

Any solution for "react-native-maps": "0.26.1" and "react-native": "0.61.5" ?

update android/build.gradle

ext {
compileSdkVersion = 28
targetSdkVersion = 28
buildToolsVersion = "28.0.3"
supportLibVersion = "28.0.0"
googlePlayServicesVersion = "17.0.0"
androidMapsUtilsVersion = "0.5+"
gradle3EXPERIMENTAL = "yes"
}

update android/app/build.gradle

implementation project(':react-native-maps')
implementation "com.google.android.gms:play-services-base:17+"
implementation 'com.google.android.gms:play-services-maps:17+'

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