Ash*_*hew 9 sdk android firebase react-native react-native-firebase
我当前在 React Native 上的 android 目标 sdk 是 28,但 Play Store 显示将其更新为 29。所以我在 android/build.gradle 中进行了以下更改
buildscript {
ext {
googlePlayServicesVersion = "16.0.0"
firebaseVersion = "17.3.4"
buildToolsVersion = "28.0.3" //changed to 29.0.3
minSdkVersion = 16
compileSdkVersion = 28 //changed to 29
targetSdkVersion = 28 // changed to 29
supportLibVersion = "28.0.0"
}
}
Run Code Online (Sandbox Code Playgroud)
但是现在当我运行 npx react-native run-android 时出现以下错误。
Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find com.android.support:support-v4:29.0.0.
Required by:
project :app
project :app > project :react-native-firebase
> Could not find com.android.support:support-v4:29.0.0.
Required by:
project :app > com.google.android.gms:play-services-basement:16.2.0
Run Code Online (Sandbox Code Playgroud)
我正在使用 react-native-firebase v5
小智 0
请按照以下步骤操作:-
android/build.gradle在您的 React Native 项目中打开。compileSdkVersion和targetSdkVersion值增加到29。在
android/build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
// ...
}
allprojects {
// ...
}
Run Code Online (Sandbox Code Playgroud)
File> Sync Project with Gradle Files)。你应该已经准备好了。
| 归档时间: |
|
| 查看次数: |
1597 次 |
| 最近记录: |