首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React Native with @react-native-community/google-signin :已经存在的程序类型: co.apptailor.googlesignin.PendingAuthRecovery

React Native with @react-native-community/google-signin :已经存在的程序类型: co.apptailor.googlesignin.PendingAuthRecovery
EN

Stack Overflow用户
提问于 2020-07-13 11:01:12
回答 1查看 576关注 0票数 2

该错误出现在包含React Native和Firebase的TypeScript项目上:

代码语言:javascript
复制
    "@react-native-community/google-signin": "^4.0.3",
    "@react-native-firebase/app": "^8.2.0",
    "@react-native-firebase/auth": "^8.0.8",
    "@react-native-firebase/firestore": "^7.2.2",
    "@react-native-firebase/storage": "^7.1.6",
    "@react-navigation/native": "^5.6.0",
    "prop-types": "react-native-community/google-signin",
    "react": "16.11.0",
    "react-native": "0.62.2",
    ...

在添加@react-native-community/google-signin之前,在Android上构建项目。然后我添加了它,并按照下面的步骤操作:https://github.com/react-native-community/google-signin/blob/master/docs/android-guide.md

我用./gradlew清理了构建

现在,当我运行yarn android时,我有:

代码语言:javascript
复制
D8: Program type already present: co.apptailor.googlesignin.PendingAuthRecovery

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:multiDexListDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Error while merging dex archives:
     Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
     Program type already present: co.apptailor.googlesignin.PendingAuthRecovery

我检查了build.gradle文件,但没有找到我可以添加的其他与身份验证相关的依赖项。该项目相对较新。

在android/app/build.gradle中,我有:

代码语言:javascript
复制
dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    implementation "com.android.support:appcompat-v7:23.0.1"
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules
    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
    implementation 'com.android.support:multidex:1.0.3'
    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }
    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }
    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}

我在这里进行了所需的检查,但没有成功:https://github.com/react-native-community/google-signin/issues/763

EN

回答 1

Stack Overflow用户

发布于 2020-07-13 11:35:51

这是由于package.json中的这一行:

代码语言:javascript
复制
"prop-types": "react-native-community/google-signin",

我删除了prop-type:

代码语言:javascript
复制
yarn remove prop-types

现在,事情就像一个护身符一样工作。

这可能不是添加类型的好方法。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/62868646

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档