Git Product home page Git Product logo

Comments (52)

elie222 avatar elie222 commented on July 28, 2024 24

I'm having this problem with Android. I have Google sign in working on iOS

from google-signin.

SantoshShabadi avatar SantoshShabadi commented on July 28, 2024 16

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.

Ignacio01 avatar Ignacio01 commented on July 28, 2024 8

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.

TEJATJ avatar TEJATJ commented on July 28, 2024 2

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.

elie222 avatar elie222 commented on July 28, 2024 1

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.

jackbackes avatar jackbackes commented on July 28, 2024 1

@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.

cmaring avatar cmaring commented on July 28, 2024 1

Facing the same issue for Android developing on Mac. Any update?

from google-signin.

uc-pya avatar uc-pya commented on July 28, 2024 1

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.

victoryforphil avatar victoryforphil commented on July 28, 2024 1

Same Issue. Windows. Android

from google-signin.

Fantasim avatar Fantasim commented on July 28, 2024 1

Same issue on Android developing on mac and on react-native 0.39.

from google-signin.

WilliamAnputra avatar WilliamAnputra commented on July 28, 2024 1

@SantoshShabadi your solution works. Thanks

from google-signin.

Uzairrrr avatar Uzairrrr commented on July 28, 2024 1

@SantoshShabadi your solution move me to a new error, help if you see this too?
screen shot 2018-09-10 at 8 20 12 pm

from google-signin.

anotherstarburst avatar anotherstarburst commented on July 28, 2024

Didn't read the setup instructions properly :/

from google-signin.

andfs avatar andfs commented on July 28, 2024

@anotherstarburst I'm with the same problem. Please tell me the solution

from google-signin.

devfd avatar devfd commented on July 28, 2024

@anotherstarburst you need to import this plugin to xcode and also add the .a library to your build compilation

from google-signin.

andfs avatar andfs commented on July 28, 2024

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.

devfd avatar devfd commented on July 28, 2024

Please have a look at the sample app to spot any differences with your xcode config

from google-signin.

Jorianiiita avatar Jorianiiita commented on July 28, 2024

@devfd i'm using sublime text and using this plugin for android apps...can u ..tell the solution to this problem

from google-signin.

nazywamsiepawel avatar nazywamsiepawel commented on July 28, 2024

+1, same issue here

from google-signin.

avishayhajbi avatar avishayhajbi commented on July 28, 2024

+1

from google-signin.

amyb87 avatar amyb87 commented on July 28, 2024

I am also having the same issue as you @elie222.

from google-signin.

avishayhajbi avatar avishayhajbi commented on July 28, 2024

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.

jackbackes avatar jackbackes commented on July 28, 2024

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.

jackbackes avatar jackbackes commented on July 28, 2024

@andfs did you ever fix this issue?

from google-signin.

andfs avatar andfs commented on July 28, 2024

@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.

andfs avatar andfs commented on July 28, 2024

@thejohnbackes no problem in rn 0.37

from google-signin.

stanleycyang avatar stanleycyang commented on July 28, 2024

Did anyone figure it out for Android yet?

from google-signin.

naveedmastan avatar naveedmastan commented on July 28, 2024

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.

jetpack3331 avatar jetpack3331 commented on July 28, 2024

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.

uc-pya avatar uc-pya commented on July 28, 2024

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.

radvc avatar radvc commented on July 28, 2024

Having same issue, anyone fixes this issue?

from google-signin.

danny-does-stuff avatar danny-does-stuff commented on July 28, 2024

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.

BerndWessels avatar BerndWessels commented on July 28, 2024

@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.

uc-pya avatar uc-pya commented on July 28, 2024

@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.

uc-pya avatar uc-pya commented on July 28, 2024

@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.

microhlab avatar microhlab commented on July 28, 2024

@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.

uc-pya avatar uc-pya commented on July 28, 2024

@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.

theankurkedia avatar theankurkedia commented on July 28, 2024

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.

fatinWasta avatar fatinWasta commented on July 28, 2024

still going through the same problem while integrating with iOS.
Anyone got solution?

from google-signin.

fatinWasta avatar fatinWasta commented on July 28, 2024

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.

vanhoutk avatar vanhoutk commented on July 28, 2024

@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.

fatinWasta avatar fatinWasta commented on July 28, 2024

@vanhoutk
Yes, that's what worked for me.
What is your XCode version?
Also if possible share your code .

from google-signin.

vanhoutk avatar vanhoutk commented on July 28, 2024

@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.

fatinWasta avatar fatinWasta commented on July 28, 2024

@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.

 avatar commented on July 28, 2024

facing the same issue. v 0.12.0

from google-signin.

fatinWasta avatar fatinWasta commented on July 28, 2024

@kalevigit try downgrading to version 0.6 it's iOS. And try with demo project first.

from google-signin.

kohchihao avatar kohchihao commented on July 28, 2024

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.

samernady avatar samernady commented on July 28, 2024

Any updates on this i am still facing the same problem

from google-signin.

Uzairrrr avatar Uzairrrr commented on July 28, 2024

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.

Nirodha261 avatar Nirodha261 commented on July 28, 2024

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.

rajngarg avatar rajngarg commented on July 28, 2024

If anyone having problem with iOS check that you have successfully installed the pods.

from google-signin.

ombogdan avatar ombogdan commented on July 28, 2024

+1

from google-signin.

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.