Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/230.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
Android 添加Google Firebase身份验证后,清单合并失败_Android_Firebase Authentication_Android Manifest_Manifest Merging - Fatal编程技术网

Android 添加Google Firebase身份验证后,清单合并失败

Android 添加Google Firebase身份验证后,清单合并失败,android,firebase-authentication,android-manifest,manifest-merging,Android,Firebase Authentication,Android Manifest,Manifest Merging,在将Firebase身份验证添加到应用程序实现后,我得到了一个清单合并失败错误 清单合并失败,出现多个错误,请参阅日志 我尝试使用不同版本的身份验证,但没有成功。 StackOverflow中相同类型问题的解决方案对我不起作用 我在合并清单中尝试了建议的更改,但此错误再次出现 合并错误:错误:在第6行指定的工具:替换 属性android:appComponentFactory,但没有为应用程序指定新值 主清单(此文件),第5行错误:验证失败,正在退出 应用程序主清单(此文件) 我需要消除此错误。

在将Firebase身份验证添加到应用程序实现后,我得到了一个清单合并失败错误

清单合并失败,出现多个错误,请参阅日志

我尝试使用不同版本的身份验证,但没有成功。 StackOverflow中相同类型问题的解决方案对我不起作用

我在合并清单中尝试了建议的更改,但此错误再次出现

合并错误:错误:在第6行指定的工具:替换 属性android:appComponentFactory,但没有为应用程序指定新值 主清单(此文件),第5行错误:验证失败,正在退出 应用程序主清单(此文件)


我需要消除此错误。

发生这种情况是因为您使用的是简单依赖项或androidx支持依赖项。这就是为什么会发生这种错误

删除Manifest.xml中行下方的内容

工具:replace=“android:appComponentFactory”

在build.gradle中使用此依赖项

实现'com.google.firebase:firebase核心:16.0.9'

实现'com.google.firebase:firebase auth:17.0.0'


删除build.gradle文件和同步项目中的所有androidx依赖项。

请将已添加到firebase中用于身份验证的代码片段迁移到androidx它将修复清单合并问题:支持androidx包的最新firebase库这是显示错误的原因我执行了你建议的修改很有效。我想知道的是firebase core和firebase auth的版本是如何做到这一点的?针对不同问题使用不同版本的基础是什么?我的建议是使用最新的依赖项。但是上个月Firebase在androidx中迁移了他们最新的依赖性,我们使用了第三方依赖性,而androidx依赖性没有使用,这就是为什么我们必须降低Firebase依赖性的原因。Android现在将在将来迁移到androidx中的所有依赖项。所以,有一天这个问题解决后,不要担心。有关更多信息,请访问Android开发者博客。快乐的编码。这个答案真的很有帮助!顺便说一句:从2019年6月17日开始,firebase SDK要求将应用程序迁移到androidX:很高兴知道这个答案对您有用@刘文斌没有。
    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        tools:replace="android:appComponentFactory">
        <activity android:name=".VerifyEmployeeID"></activity>
        <activity android:name=".SignUp" />
        <activity android:name=".login" />
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'


    implementation 'com.google.firebase:firebase-core:16.0.5'
    implementation 'com.google.firebase:firebase-auth:16.0.5'

    //firebase database
    implementation 'com.google.firebase:firebase-database:16.0.4'

    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'