将ExpoKit从SDK 32更新到SDK 33后,无法解析androidx.vectordrawable:vectordrawable:1.0.0

时间:2019-07-23 11:37:30

标签: react-native react-native-android expo

将ExpoKit项目从SDK 32更新到SDK 33之后,Android项目中出现了很多错误。

我按照官方指南更新了ExpoKit

这是我得到的错误:

ERROR: Manifest merger failed : Attribute data@scheme at manifestMerger6401876400338623003.xml requires a placeholder substitution  but no value for <appAuthRedirectScheme> is provided.


Could not determine the dependencies of task ':app:compileDebugAidl'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve androidx.vectordrawable:vectordrawable:1.0.0.
     Required by:
         project :app
      > Cannot find a version of 'androidx.vectordrawable:vectordrawable' that satisfies the version constraints: 
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable:1.0.1'
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable-animated:1.0.0' --> 'androidx.vectordrawable:vectordrawable:1.0.0'
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0

   > Could not find host.exp.exponent:expoview:33.0.4.
     Required by:
         project :app
   > Could not resolve androidx.vectordrawable:vectordrawable:1.0.1.
     Required by:
         project :app > androidx.appcompat:appcompat:1.0.2
      > Cannot find a version of 'androidx.vectordrawable:vectordrawable' that satisfies the version constraints: 
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable:1.0.1'
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable-animated:1.0.0' --> 'androidx.vectordrawable:vectordrawable:1.0.0'
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0

   > Could not resolve androidx.vectordrawable:vectordrawable:1.0.0.
     Required by:
         project :app > androidx.vectordrawable:vectordrawable-animated:1.0.0
      > Cannot find a version of 'androidx.vectordrawable:vectordrawable' that satisfies the version constraints: 
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable:1.0.1'
           Dependency path 'android:app:unspecified' --> 'androidx.appcompat:appcompat:1.0.2' --> 'androidx.vectordrawable:vectordrawable-animated:1.0.0' --> 'androidx.vectordrawable:vectordrawable:1.0.0'
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0
           Constraint path 'android:app:unspecified' --> 'androidx.vectordrawable:vectordrawable' strictly '1.0.0' because of the following reason: debugRuntimeClasspath uses version 1.0.0

2 个答案:

答案 0 :(得分:0)

我使用jetifier

解决了这个问题
npm i jetifier && npx jetify

答案 1 :(得分:0)

Jetifier节点模块应该运行android的官方jetifier-standalone工具,该工具可以迁移依赖于支持库的库,而改为依赖等效的AndroidX软件包。

安装节点模块jetifier

yarn add -D jetifier

npm install --save-dev jetifier

您可以运行

npx jetify

但是您最好将npx jetify添加到您的package.json``后安装脚本中

  "name": "...",
  "scripts": {
    "start": "...",
    "android": "...",
    "ios": "...",
    "postinstall": "npx jetify"
  }