Git Product home page Git Product logo

Comments (16)

ryanmcdermott avatar ryanmcdermott commented on July 19, 2024

Some more info here: https://stackoverflow.com/questions/33556780/errorexecution-failed-for-task-appprocessdebuggoogleservices-please-fix/33558478#33558478

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

Did the link solve your problem?

from react-native-gcm-android.

ryanmcdermott avatar ryanmcdermott commented on July 19, 2024

I modified the code of your module and upgraded this in the build.gradle file:
compile 'com.google.android.gms:play-services:8.3.0'

That got it to stop throwing an error but GCM permissions request is still not showing up in emulator.

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

OK, this thing should be also mentioned in docs to help others prevent facing this issue.
I didn't test it, but can you test it in device?
Otherwise, you can run adb logcat in terminal and run the app, and then try searching text GCM Registration Token or Failed to complete token refresh. It will get some informations.

from react-native-gcm-android.

ryanmcdermott avatar ryanmcdermott commented on July 19, 2024

Tried running it on device, it crashes when starting up. Here's the adb log:

E/AndroidRuntime(18628): FATAL EXCEPTION: main
E/AndroidRuntime(18628): Process: com.app.name, PID: 18628
E/AndroidRuntime(18628): java.lang.UnsatisfiedLinkError: could find DSO to load: libreactnativejni.so
E/AndroidRuntime(18628):    at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:213)
E/AndroidRuntime(18628):    at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:178)
E/AndroidRuntime(18628):    at com.facebook.react.bridge.JSCJavaScriptExecutor.<clinit>(JSCJavaScriptExecutor.java:19)
E/AndroidRuntime(18628):    at com.facebook.react.ReactInstanceManager.onJSBundleLoadedFromServer(ReactInstanceManager.java:310)
E/AndroidRuntime(18628):    at com.facebook.react.ReactInstanceManager.initializeReactContext(ReactInstanceManager.java:321)
E/AndroidRuntime(18628):    at com.facebook.react.ReactInstanceManager.attachMeasuredRootView(ReactInstanceManager.java:265)
E/AndroidRuntime(18628):    at com.facebook.react.ReactRootView$1.run(ReactRootView.java:105)
E/AndroidRuntime(18628):    at android.os.Handler.handleCallback(Handler.java:739)
E/AndroidRuntime(18628):    at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime(18628):    at android.os.Looper.loop(Looper.java:135)
E/AndroidRuntime(18628):    at android.app.ActivityThread.main(ActivityThread.java:5310)
E/AndroidRuntime(18628):    at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18628):    at java.lang.reflect.Method.invoke(Method.java:372)
E/AndroidRuntime(18628):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
E/AndroidRuntime(18628):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)

Try running it on yours if you can. If there's an example project you have that would be great.

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

No problem. Here you go https://github.com/oney/TestGcm
I run the app in my device with Android 4.1.2, and it just works
Logs are

D/ReactNativeJS(29078): 'Running application "TestGcm" with appParams: {"initialProps":{},"rootTag":1}. __DEV__ === true, development-level warning are ON, performance optimizations are OFF'
D/ReactNativeJS(29078): 'send gcm token to server', 'eoupdMSUPFI:APA91bFdAfjIVcs4dWkhqX8trwHGvStiDOwF2e1QNzSBVIC6qJha-6hjWNDi8gLy0uxldQtq9zHqZOUqw9tJs8MR5wIbvvltGjuo0AxSglcFb8KDKdCAbz4_vW2vSvB3CV2OP1l2Wq1D'

Maybe your problem is related to this. What is your device?

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

I test the demo app in Genymotion simulator(Google Galaxy Nexus 4.1.1 API 16). It can't get the token.
adb logcat shows

D/GcmRegistrationService(  998): Failed to complete token refresh
D/GcmRegistrationService(  998): java.io.IOException: MISSING_INSTANCEID_SERVICE
D/GcmRegistrationService(  998):    at com.google.android.gms.iid.zzc.zza(Unknown Source)
D/GcmRegistrationService(  998):    at com.google.android.gms.iid.zzc.zzb(Unknown Source)
D/GcmRegistrationService(  998):    at com.google.android.gms.iid.zzc.zza(Unknown Source)
D/GcmRegistrationService(  998):    at com.google.android.gms.iid.InstanceID.zzc(Unknown Source)
D/GcmRegistrationService(  998):    at com.google.android.gms.iid.InstanceID.getToken(Unknown Source)
D/GcmRegistrationService(  998):    at com.oney.gcm.GcmRegistrationService.onHandleIntent(GcmRegistrationService.java:38)
D/GcmRegistrationService(  998):    at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
D/GcmRegistrationService(  998):    at android.os.Handler.dispatchMessage(Handler.java:99)
D/GcmRegistrationService(  998):    at android.os.Looper.loop(Looper.java:137)
D/GcmRegistrationService(  998):    at android.os.HandlerThread.run(HandlerThread.java:60)
I/ActivityManager(  293): No longer want com.android.contacts (pid 662): hidden #16

It seems that GCM doesn't work in Genymotion simulator

from react-native-gcm-android.

ryanmcdermott avatar ryanmcdermott commented on July 19, 2024

Thanks for the example project! I'm using an Android device that I believe is experiencing the same issue as the 64-bit one you posted. Let's keep this GitHub issue open for now, while I work on resolving it. For now I'll try getting your TestGcm to work, then I'll go back to my app.

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

not sure what , why or how
but adding google-services.json to react-native-gcm-android folder (i also it inside the android directory + android/build ((lots of trial and error)) + updating to 8.3.0 and classpath to
classpath 'com.google.gms:google-services:1.5.0-beta2'

got rid of the error for me

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

nevermind the upgrading bit.

noticed that i got this error instead
No matching client found for package name 'com.oney.gcm'

from react-native-gcm-android.

oney avatar oney commented on July 19, 2024

@jawadrehman Are you testing demo project(https://github.com/oney/TestGcm)? And what is your device?

from react-native-gcm-android.

jawadrehman avatar jawadrehman commented on July 19, 2024

even with the demo project i got that message, but it does get the token

from react-native-gcm-android.

lukefanning avatar lukefanning commented on July 19, 2024

@oney Hi there, I was getting the same issue but managed to resolve it in a very simple way. I had to remove the apply plugin line for google services from your modules build.gradle. Worked perfectly after doing that. I created a PR with the fix.

from react-native-gcm-android.

cristiansan avatar cristiansan commented on July 19, 2024

I put this one:
compile "com.google.firebase:firebase-database:9.2.0"
sync with gradle and works for me.

from react-native-gcm-android.

jchrix avatar jchrix commented on July 19, 2024

screenshot 7
after modifying your build.gradle file
i.e Project-level build.gradle (/build.gradle):
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:4.0.0'
}
}

   App-level build.gradle (<project>/<app-module>/build.gradle): 

                                dependencies {
                                        // Add this line
                                               compile 'com.google.firebase:firebase-core:16.0.0'
                                                        }

                            // Add to the bottom of the file
                                 apply plugin: 'com.google.gms.google-services'

NOTE: then copy the json file you downloaded and paste it twice as in the image above. and you're good to go.

from react-native-gcm-android.

ashwath20 avatar ashwath20 commented on July 19, 2024

for me removing "apply plugin: 'com.google.gms.google-services'" from app level gradle file worked

from react-native-gcm-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.