Comments (52)
I'm having this problem with Android. I have Google sign in working on iOS
from google-signin.
Hi Guys... I was having the same issue which just got resolved.
all you need to do is in the js files GoogleSignin.ios.js and GoogleSignin.android.js (located in
node_modules/react-native-google-signin/src/) replace the below constants
GoogleSigninButton.Size = {
Icon: RNGoogleSignin.BUTTON_SIZE_ICON,
Standard: RNGoogleSignin.BUTTON_SIZE_STANDARD,
Wide: RNGoogleSignin.BUTTON_SIZE_WIDE
};
GoogleSigninButton.Color = {
Auto: RNGoogleSignin.BUTTON_COLOR_AUTO,
Light: RNGoogleSignin.BUTTON_COLOR_LIGHT,
Dark: RNGoogleSignin.BUTTON_COLOR_DARK
};
with
GoogleSigninButton.Size = {
Icon: '48 x 48',
Standard: '230 x 48',
Wide: '312 x 48'
};
GoogleSigninButton.Color = {
Auto: 'white',
Light: 'blue',
Dark: 'grey'
};
from google-signin.
Hello guys! I had that problem and it was because I didn't initialise the project! Following the steps of this link I was able to solve the problem!
https://github.com/devfd/react-native-google-signin/blob/master/ios-guide.md
from google-signin.
Same issue in android...
Issue might arise when you are messing with MainApplication.java or MainActivity.java
Solution in the above case:
just unlink react-native-google-signin and link it again.
from google-signin.
Annoying this was working for me at one point for Android and I'm now back to this issue again. Not sure how I fixed it the first time.
from google-signin.
@andfs that's what I figured. haven't had a chance to update yet, but I'll post here as well if that resolved the issue.
from google-signin.
Facing the same issue for Android developing on Mac. Any update?
from google-signin.
undefined is not an object (evaluating 'RNGoogleSignin.BUTTON_SIZE_ICON') getting on android on updation of React native 0.39...
anyone can tell how to fix it
from google-signin.
Same Issue. Windows. Android
from google-signin.
Same issue on Android developing on mac and on react-native 0.39.
from google-signin.
@SantoshShabadi your solution works. Thanks
from google-signin.
@SantoshShabadi your solution move me to a new error, help if you see this too?
from google-signin.
Didn't read the setup instructions properly :/
from google-signin.
@anotherstarburst I'm with the same problem. Please tell me the solution
from google-signin.
@anotherstarburst you need to import this plugin to xcode and also add the .a library to your build compilation
from google-signin.
Well, I think that I did it.
In my xcode project I have Under my project name: RNGoogleSignin.h RNGoogleSignin.m and RNGoogleSigninManager.m
In Build Phases -> Link Binary With Libraries exists GoogleSignIn.framework and my LibPods .a
I realy don't know what I'm missing. I've tried to follow these steps: Add RNGoogleSignin folder to your XCode project but I think that I added the RNGoogleSignin folder at the wrong place. Could you try to help me with these problem?
from google-signin.
Please have a look at the sample app to spot any differences with your xcode config
from google-signin.
@devfd i'm using sublime text and using this plugin for android apps...can u ..tell the solution to this problem
from google-signin.
+1, same issue here
from google-signin.
+1
from google-signin.
I am also having the same issue as you @elie222.
from google-signin.
It happened to me too.
I'm just start a new project and it works.
On Thu, Sep 8, 2016, 19:40 Amy Bakameyer [email protected] wrote:
I am also having the same issue as you @elie222
https://github.com/elie222.—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#56 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEv7PyiU3f2Bn7TVXcFyPZWhuxtnau6sks5qoDpsgaJpZM4ICvp6
.
from google-signin.
if anyone has been able to fix this issue, please post the fix here. I have been struggling with this for a week. As far as I can tell, my xcode config is the same. @anotherstarburst I realize this is an old issue, but do you have any idea how you fixed this? I saw you said that you "read the setup incorrectly." Which part? What change did you make?
from google-signin.
@andfs did you ever fix this issue?
from google-signin.
@thejohnbackes no i didn't
I gave up google login until someone tell that it's working. I lost almost 3 weeks in this issue.
from google-signin.
@thejohnbackes no problem in rn 0.37
from google-signin.
Did anyone figure it out for Android yet?
from google-signin.
I ma also facing the same issue It works fine in IOS but not in android
Can anyone please figure this out fast!
from google-signin.
I gave up that login too, error is obvious, but where i can find that Native BUTTON_ICON i don't know.
Hopefully author will update documentation for what to do wit that and add it to FAQ or something.
from google-signin.
solution:-
first initialise package by writing " new RNGoogleSigninPackage() ", in mainApplication.java constructor and u can comment the BUTTTON_ICON codes in RNGoogleSingin.js because this code does't use in execution.
from google-signin.
Having same issue, anyone fixes this issue?
from google-signin.
Alright I had the same problem but it's now working! I went back through the iOS-guide (https://github.com/devfd/react-native-google-signin/blob/master/ios-guide.md) and made sure I did EVERY step. It still wasn't working, but then I cleaned my Xcode project (CMD-SHIFT-K), built the project (CMD-B) (Even though Xcode was showing some errors). After all of this I restarted my app by stopping the packager, closing out of terminal, and running react-native run-ios
.
I believe the step that actually made it start working was restarting the packager, but I'm not sure. Hopefully this will help someone else!
Xcode 8.3.2
RN 0.44.0
from google-signin.
@uc-pya Hi, I get this problem on Android too - can you be more specific how you fixed it please?
this is my MainApplication.java
package com.mobileapp;
import android.app.Application;
import com.facebook.react.ReactApplication;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import java.util.Arrays;
import java.util.List;
import com.reactlibrary.googlesignin.RNGoogleSignInPackage;
public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new RNGoogleSignInPackage()
);
}
};
@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
@Override
public void onCreate() {
super.onCreate();
SoLoader.init(this, /* native exopackage */ false);
}
}
from google-signin.
@BerndWessels
hi, you have initialise constructor of RNGoogleSignInPackage in mainApplication.java,
u can check path and make sure your packager is running proper so please restart your packager and check watchman to configure right path,
if still this is coming then u can comment comment the BUTTTON_ICON codes in RNGoogleSingin.js
which saved in node modules ,
import React, { Component, PropTypes } from 'react';
import {
View,
DeviceEventEmitter,
NativeModules,
requireNativeComponent,
} from 'react-native';
const { RNGoogleSignin } = NativeModules;
const RNGoogleSigninButton = requireNativeComponent('RNGoogleSigninButton', {
name: 'RNGoogleSigninButton',
propTypes: {
...View.propTypes,
size: PropTypes.number,
color: PropTypes.number
}
});
class GoogleSigninButton extends Component {
componentDidMount() {
this._clickListener = DeviceEventEmitter.addListener('RNGoogleSigninButtonClicked', () => {
this.props.onPress && this.props.onPress();
});
}
componentWillUnmount() {
this._clickListener && this._clickListener.remove();
}
render() {
return (
<RNGoogleSigninButton {...this.props}/>
);
}
}
GoogleSigninButton.Size = {
Icon: RNGoogleSignin.BUTTON_SIZE_ICON,
Standard: RNGoogleSignin.BUTTON_SIZE_STANDARD,
Wide: RNGoogleSignin.BUTTON_SIZE_WIDE
};
GoogleSigninButton.Color = {
Auto: RNGoogleSignin.BUTTON_COLOR_AUTO,
Light: RNGoogleSignin.BUTTON_COLOR_LIGHT,
Dark: RNGoogleSignin.BUTTON_COLOR_DARK
};
class GoogleSigninError extends Error {
constructor(error, code) {
super(error);
this.name = 'GoogleSigninError';
this.code = code;
}
}
class GoogleSignin {
constructor() {
this._user = null;
}
hasPlayServices(params = {autoResolve: true}) {
return RNGoogleSignin.playServicesAvailable(params.autoResolve);
}
configure(params={}) {
params = [
params.scopes || [], params.webClientId || null, params.offlineAccess || false
];
return RNGoogleSignin.configure(...params);
}
currentUserAsync() {
return new Promise((resolve, reject) => {
const sucessCb = DeviceEventEmitter.addListener('RNGoogleSignInSilentSuccess', (user) => {
this._user = user;
RNGoogleSignin.getAccessToken(user).then((token) => {
this._user.accessToken = token;
this._removeListeners(sucessCb, errorCb);
resolve(this._user);
})
.catch(err => {
this._removeListeners(sucessCb, errorCb);
resolve(this._user);
});
});
const errorCb = DeviceEventEmitter.addListener('RNGoogleSignInSilentError', (err) => {
this._removeListeners(sucessCb, errorCb);
resolve(null);
});
RNGoogleSignin.currentUserAsync();
});
}
currentUser() {
return {...this._user};
}
signIn() {
return new Promise((resolve, reject) => {
console.log("Hi Jarvis function call");
const sucessCb = DeviceEventEmitter.addListener('RNGoogleSignInSuccess', (user) => {
this._user = user;
console.log("Test");
RNGoogleSignin.getAccessToken(user).then((token) => {
this._user.accessToken = token;
this._removeListeners(sucessCb, errorCb);
resolve(this._user);
})
.catch(err => {
this._removeListeners(sucessCb, errorCb);
resolve(this._user);
});
});
const errorCb = DeviceEventEmitter.addListener('RNGoogleSignInError', (err) => {
console.log("Hi Ashu error");
this._removeListeners(sucessCb, errorCb);
reject(new GoogleSigninError(err.error, err.code));
});
RNGoogleSignin.signIn();
});
}
signOut() {
return new Promise((resolve, reject) => {
const sucessCb = DeviceEventEmitter.addListener('RNGoogleSignOutSuccess', () => {
this._removeListeners(sucessCb, errorCb);
resolve();
});
const errorCb = DeviceEventEmitter.addListener('RNGoogleSignOutError', (err) => {
this._removeListeners(sucessCb, errorCb);
reject(new GoogleSigninError(err.error, err.code));
});
this._user = null;
RNGoogleSignin.signOut();
});
}
revokeAccess() {
return new Promise((resolve, reject) => {
const sucessCb = DeviceEventEmitter.addListener('RNGoogleRevokeSuccess', () => {
this._removeListeners(sucessCb, errorCb);
RNGoogleSignin.revokeAccess();
resolve();
});
const errorCb = DeviceEventEmitter.addListener('RNGoogleRevokeError', (err) => {
this._removeListeners(sucessCb, errorCb);
reject(new GoogleSigninError(err.error, err.code));
});
});
}
_removeListeners(...listeners) {
listeners.forEach(lt => lt.remove());
}
}
module.exports = {GoogleSignin: new GoogleSignin(), GoogleSigninButton};
from google-signin.
@BerndWessels and once read this instruction and configure according that,
https://github.com/devfd/react-native-google-signin/blob/master/android-guide.md
from google-signin.
@uc-pya I've tried comment it out, then the error became BUTTON_SIZE_STANDARD, it's about RNGoogleSignin was not been loaded correctly, don't know why.
I've pasted google-services.json but not working.
It's 2017 now
from google-signin.
@marxsm yes right RNGoogleSignin is not proper loading native modules so check watcher config and packager that is proper loading or not and also check setings-gradle and xcode library serach path to load proper assets.
from google-signin.
For android, the problem is that the changes made as instructed in the docs are not being persisted. After making the changes in the said files, just sync project with gradle files and then run. Worked for me.
from google-signin.
still going through the same problem while integrating with iOS.
Anyone got solution?
from google-signin.
Finally, spending one week,
upgrading my react-native-google-signin from 0.8.1 to 0.11.0 resolved my problem.
hope this helps.
from google-signin.
@fatinWasta Is that the only thing you've changed? I've tried it with both 0.12.0 and 0.11.0 now and I'm still getting the same issue!
from google-signin.
@vanhoutk
Yes, that's what worked for me.
What is your XCode version?
Also if possible share your code .
from google-signin.
@fatinWasta I'm actually trying to get it working with Android, I didn't notice that you'd you were integrating with iOS. Thanks anyway!
from google-signin.
@vanhoutk Welcome. BDW, still try going to different versions, cause this same sort of problem happened with me while integrating facebook too. So there are high chances that it can be because of version only. Best Lucks. 😇
from google-signin.
facing the same issue. v 0.12.0
from google-signin.
@kalevigit try downgrading to version 0.6 it's iOS. And try with demo project first.
from google-signin.
Just faced this problem. i closed all my bash terminals and the iOS simulator. Then run react-native run-ios
again
Hope this helps.
from google-signin.
Any updates on this i am still facing the same problem
from google-signin.
Hi Everybody I was having the same issue which just got resolved.
My react-native version is 0.50.4
react-natve-google-sign-in version is 0.12.0
I followed this link only automatic linking not mannual
https://github.com/react-native-community/react-native-google-signin/blob/master/ios-guide.md
and one more change in
node_modules/react-native-google-signin/src/
replace the below constants
GoogleSigninButton.Size = {
Icon: RNGoogleSignin.BUTTON_SIZE_ICON,
Standard: RNGoogleSignin.BUTTON_SIZE_STANDARD,
Wide: RNGoogleSignin.BUTTON_SIZE_WIDE
};
GoogleSigninButton.Color = {
Auto: RNGoogleSignin.BUTTON_COLOR_AUTO,
Light: RNGoogleSignin.BUTTON_COLOR_LIGHT,
Dark: RNGoogleSignin.BUTTON_COLOR_DARK
};
with
GoogleSigninButton.Size = {
Icon: '48 x 48',
Standard: '230 x 48',
Wide: '312 x 48'
};
GoogleSigninButton.Color = {
Auto: 'white',
Light: 'blue',
Dark: 'grey'
};
from google-signin.
For anyone who's still getting this error, make sure all the installations steps are followed properly.
You can reference detailed guide from the library itself under following path.
"node_modules/react-native-google-signin/docs/ios-guide.md"
from google-signin.
If anyone having problem with iOS check that you have successfully installed the pods.
from google-signin.
+1
from google-signin.
Related Issues (20)
- Error during login: [TypeError: Cannot read property 'user' of undefined] HOT 1
- Validate accessToken generate from iOS is invalid_error on server HOT 1
- My app shows google login panel, I changed the email and client Id in the code then get this error. HOT 1
- Sign in doesn't seem to be working in custom Expo Dev Client HOT 4
- URL Access Anti-virus Security issue HOT 2
- Restore Flow typings for v12 HOT 2
- [Docs] iOS docs unusable for Expo HOT 2
- Support for react-native-macos HOT 2
- Compatible version for react native 0.61.5 HOT 1
- Mock not working in 12.1.0 HOT 10
- Google Signin Works on Emulator but not on Web HOT 1
- Free Sponsor Access for Early-Stage Startups? HOT 2
- Unable to install sponsored version HOT 1
- Terminating app due to uncaught exception 'NSInvalidArgumentException' HOT 2
- Is there any cache in this library? reversed_client_id doesn't change even if Info.plist changed HOT 1
- Prevent crashes on mobile web HOT 1
- "[app] wants additional access to your Google Account" on re-sign-in on iOS. HOT 6
- google sign in not working when using an actual mobile: tried two views with the same name RNGoogleSigninButton HOT 5
- Cannot get signIn() working with Supabase HOT 15
- Dependency conflict between React and React Native versions when installing @react-native-google-signin/google-signin package HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from google-signin.