繁体   English   中英

此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 6.0 不兼容。 - 反应原生

[英]Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. - React native

当我安装React Native WebView

安装后运行react-native run-android显示错误

任务 :app:transformDexArchiveWithDexMergerForDebug 失败

此版本中使用了已弃用的Gradle功能,使其与Gradle 6.0不兼容。 使用“--warning-mode all”来显示单个弃用警告。 请参阅https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 163 个可操作任务:28 个已执行,135 个最新

包.json

"@react-native-community/async-storage": "^1.8.1",
"@react-native-community/masked-view": "^0.1.7",
"@react-navigation/native": "^5.1.3",
"native-base": "^2.13.12",
"npm-check-updates": "^4.1.0",
"react": "16.13.1",
"react-native": "0.62.0",
"react-native-gesture-handler": "^1.6.1",
"react-native-media-controls": "^1.1.1",
"react-native-paper": "^3.6.0",
"react-native-reanimated": "^1.7.1",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.4.0",
"react-native-track-player": "^1.2.2",
"react-native-video": "^5.1.0-alpha6",
"react-native-webview": "^9.0.2",
"react-navigation": "^4.3.5",
"react-navigation-drawer": "^2.4.9",
"react-navigation-stack": "^2.3.9",
"react-navigation-tabs": "^2.8.9",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-persist": "^6.0.0"

也许您的应用程序具有 64K 或更多的方法。 你可以在android/app/build.gradle添加这个

android{
defaultConfig{
  .......
 multiDexEnabled true 
  }
}

dependencies {
    ...
    def multidex_version = "2.0.1"
    implementation 'androidx.multidex:multidex:$multidex_version'
}

主应用程序

public class MainApplication extends MultiDexApplication implements ReactApplication {

恢复上次添加的包或资产文件(例如:运行react-native run-android时有时图像损坏和错误)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM