Android 构建错误“AndroidManifest.xml 需要占位符替换”

man*_*urt 15 android react-native

我正在为 Android 构建 reactNative 应用程序,但出现此错误:

清单合并失败:AndroidManifest.xml 中的属性 data@scheme 需要占位符替换,但未提供任何值。

这是什么错误?如何解决?干杯

man*_*urt 21

在里面

应用程序构建.gradle

android {
compileSdkVersion 26
buildToolsVersion '26.0.3'

defaultConfig {
    applicationId "com.chuchas.comm"
    ...

    // place correct redirectScheme~
    manifestPlaceholders = [appAuthRedirectScheme: 'com.redirectScheme.comm']

}
Run Code Online (Sandbox Code Playgroud)

  • 我是新来的。如何在应用程序中找到 appAuthRedirectScheme? (2认同)

Had*_*zar 6

尝试添加manifestPlaceholders

https://github.com/FormidableLabs/react-native-app-auth#add-redirect-scheme-manifest-placeholder

android {
  defaultConfig {
    manifestPlaceholders = [
      appAuthRedirectScheme: 'io.identityserver.demo'
    ]
  }
}
Run Code Online (Sandbox Code Playgroud)


小智 6

在应用程序中build.gradle,导航到该defaultConfig部分并添加以下行。

源代码

   defaultConfig {
    ...
    manifestPlaceholders = [appAuthRedirectScheme: 'com.redirectScheme.comm']
}
Run Code Online (Sandbox Code Playgroud)