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

RNGoogleSigninModule is not abstract and does not override abstract method onActivityResult #132

Closed
manjeet-dobble opened this issue Sep 30, 2016 · 13 comments

Comments

@manjeet-dobble
Copy link

Followed all the step giving in the android guide for setup, but still getting following error -
myProject\node_modules\react-native-google-signin\android\src\main\java\co\apptailor\googlesignin\RNGoogleSigninModule.java:40: error: RNGoogleSigninModule is not abstract and does not override abstract method onActivityResult(int,int,Intent) in ActivityEventListener public class RNGoogleSigninModule extends ReactContextBaseJavaModule implements ActivityEventListener { ^ C:\myProject\node_modules\react-native-google-signin\android\src\main\java\co\apptailor\googlesignin\RNGoogleSigninModule.java:53: error: method does not override or implement a method from a supertype @Override ^ 2 errors :react-native-google-signin:compileReleaseJavaWithJavac FAILED

react-native version 0.30
library version - 0.8.1

android/bluid.gradle -
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'

android/app/build.gradle-

compile project(':react-native-google-signin')
compile(project(":react-native-google-signin")){
exclude group: "com.google.android.gms" // very important
}
android/setting.gradle
include ':react-native-google-signin'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-signin/android')

@mkdotcom
Copy link

mkdotcom commented Oct 4, 2016

upgrading to react-native 0.34.1 fixed the issue on my project

@mvnnn
Copy link

mvnnn commented Oct 5, 2016

@manjeet-dobble @mkdotcom

react-native - 0.34.1
react-native-google-signin - 0.8.1

i implemented" android guide" but i get this error
screenshot_1475622566

@manjeet-dobble
Copy link
Author

manjeet-dobble commented Oct 5, 2016

what I did, I kept my RN version intact but removed "Activity activity" from public void onActivityResult(final int requestCode, final int resultCode, final Intent intent)
and didn't used apply plugin: 'com.google.gms.google-services' as suggested in the guide and it is working somewhat fine for me

@mvnnn
Copy link

mvnnn commented Oct 5, 2016

@manjeet-dobble thanks, that's work 👍

@manjeet-dobble
Copy link
Author

@mvnnn have you tested it in release mode ?

@mvnnn
Copy link

mvnnn commented Oct 12, 2016

@manjeet-dobble Now, "google-signin" working good.

@prithsharma
Copy link

v0.8.1 doesn't work with React Native v0.30.0 actually. @manjeet-dobble you might want to try downgrading to v0.8.0.

@manjeet-dobble
Copy link
Author

yeah I upgraded to RN 0.34.1 and its working fine now

@nayyden
Copy link

nayyden commented Oct 21, 2016

Hi, anyone having success using RN 0.35.0 + v0.8.1?

I get

...: java.lang.AbstractMethodError: abstract method "void com.facebook.react.bridge.ActivityEventListener.onActivityResult(android.app.Activity, int, int, android.content.Intent)"
...:    at com.facebook.react.bridge.ReactContext.onActivityResult(ReactContext.java:226)
...:    at com.facebook.react.XReactInstanceManagerImpl.onActivityResult(XReactInstanceManagerImpl.java:620)
...:    at com.facebook.react.ReactActivityDelegate.onActivityResult(ReactActivityDelegate.java:134)
...:    at com.facebook.react.ReactActivity.onActivityResult(ReactActivity.java:77)
...:    at android.app.Activity.dispatchActivityResult(Activity.java:6456)
...:    at android.app.ActivityThread.deliverResults(ActivityThread.java:3739)
...:    at android.app.ActivityThread.handleSendResult(ActivityThread.java:3786)
...:    at android.app.ActivityThread.access$1400(ActivityThread.java:153)
...:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
...:    at android.os.Handler.dispatchMessage(Handler.java:102)
...:    at android.os.Looper.loop(Looper.java:148)
...:    at android.app.ActivityThread.main(ActivityThread.java:5466)
...:    at java.lang.reflect.Method.invoke(Native Method)
...:    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
...:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
...:   Force finishing activity 

As far as I understand, the error means that something was compiled with older version of a jar, and during runtime a newer version of the jar is used.

PS: I haven't managed to trace why this happens yet, Android Studio doesn't hint for any problems either. Any suggestions are welcome, I could try them right away and report if it works.

@mvnnn
Copy link

mvnnn commented Oct 21, 2016

@nayyden i I upgraded to RN 0.35.0 + v0.8.1. in my case it's working. see above discussion that's might helps you.

@nayyden
Copy link

nayyden commented Oct 21, 2016

Hi @mvnnn,

Thank you for your reply but the error I get is in runtime, not on compile.
I already tried the above solution but it doesn't work and doesn't make sense too because since v0.33 the function has Activity and it should be there.

See release notes for 0.33 (https://github.com/facebook/react-native/releases/tag/v0.33.0):

Add Activity to onActivityResult listener interface (fbd2e13) - @foghina

Maybe you are building with older version of react-native. Did you do npm install and react-native upgrade?

There is something wrong in my setup too, but the above solution actually produces the error in the issue title, does not fix my problem.

@nayyden
Copy link

nayyden commented Oct 24, 2016

I fixed my problem, i had another package which I had to upgrade too. In case you run in the same problem: search for onActivityResult and check which packages implement this function without Activity actifity. These need to be upgraded. I don't have any idea why these compiled at all, they should show error on compile time...

@Venryx
Copy link

Venryx commented Nov 20, 2016

Another solution that worked for me: include both versions as overrides! : D

Just call the not-having-activity-arg override from the having-activity-arg override, and you've got both cases handled.

Obviously not ideal, but good for beginners like me who have no idea how two react-native versions are active at the same time. (one for compile time, one for run-time)

(my issue for it, if you're wondering, from another project: https://github.com/Lichwa/react-native-file-picker/issues/3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants