Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/27.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 本地google登录失败。错误代码10_Javascript_Reactjs_React Native_Google Api - Fatal编程技术网

Javascript 本地google登录失败。错误代码10

Javascript 本地google登录失败。错误代码10,javascript,reactjs,react-native,google-api,Javascript,Reactjs,React Native,Google Api,我正在尝试在react本机应用程序中添加google登录。我按照程序中的所有步骤进行操作。 一切正常,但在通过错误声明登录后 错误的签名{“名称”:“谷歌签名错误”,“代码”:10} 我的登录页面是这样的 import {GoogleSignin, GoogleSigninButton} from 'react-native-google-signin'; componentDidMount(){ GoogleSignin.hasPlayServices({ autoRes

我正在尝试在react本机应用程序中添加google登录。我按照程序中的所有步骤进行操作。 一切正常,但在通过错误声明登录后

错误的签名{“名称”:“谷歌签名错误”,“代码”:10}

我的登录页面是这样的

import {GoogleSignin, GoogleSigninButton} from 'react-native-google-signin';

  componentDidMount(){
        GoogleSignin.hasPlayServices({ autoResolve: true }).then(() => {
            // play services are available. can now configure library
        }).catch((err) => {
                console.log("Play services error", err.code, err.message);
        });

        GoogleSignin.configure({
         scopes: ["https://www.googleapis.com/auth/drive.readonly"],//Even if i remove this the thing is same
            webClientId: "********-**********.apps.googleusercontent.com",
        }).then(() => {

        });
    }

  googleSignIn=()=>{
        GoogleSignin.signIn()
            .then((user) => {
                console.log(user);           
            })
            .catch((err) => {
                console.log('WRONG SIGNIN error', err);
            })
            .done();
    };


//Google button
 <Button onPress={()=>this.googleSignIn()}>
  <Icon style={styles.googleIcon} name="google-plus" type="FontAwesome"/>
 </Button>
从'react native google sign'导入{GoogleSignin,GoogleSigninButton};
componentDidMount(){
hasPlayServices({autoResolve:true})。然后(()=>{
//播放服务可用。现在可以配置库
}).catch((错误)=>{
log(“播放服务错误”,err.code,err.message);
});
谷歌签名({
范围:[”https://www.googleapis.com/auth/drive.readonly“],//即使我去掉这个,事情还是一样的
webClientId:“*********-***********.apps.googleusercontent.com”,
}).然后(()=>{
});
}
谷歌签名=()=>{
谷歌签名
。然后((用户)=>{
console.log(用户);
})
.catch((错误)=>{
console.log('error SIGNIN error',err);
})
.完成();
};
//谷歌按钮
this.googleSignIn()}>
我的google开发者控制台设置如下

我试图在github ISU跟踪器上检查问题,并尝试了他们的解决方案,但没有成功。
谁能告诉我哪里做错了?如您所见,我使用的示例代码是

您是否添加了正确的SHA1键?如果您正在使用已签名的apk thn,您应该已经使用密钥库文件创建了SHA1密钥。是的,我已创建并添加了SHA1密钥,这可能会对您有所帮助。是的,我按照该文档设置了project@user7747472你能解决这个问题吗。我今天也有同样的问题。