此版本中使用了已弃用的 Gradle 功能,使其与 Gradle 6.0 不兼容。安装某些库时出错

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. error while installing some libraries

我正在尝试创建一个带有抽屉导航的 React 本机应用程序,在 header 中使用带有菜单的抽屉导航,如下所示

我已经安装了如下的软件包
1.npm 安装 react-navigation
2.npm 添加 react-native-reanimated react-native-gesture-handler react-native-screens@^1.0.0-alpha.23
3.npm 添加 react-navigation-抽屉

之后抽屉菜单按预期工作,如下所示 然后我尝试在执行 npm install react-navigation 后使用堆栈导航在 header 中创建菜单-stack 在 运行 app

时出现以下错误

有时在安装后 react-native-vector-icons 也会遇到同样的错误,请在此先感谢

试试这个;

打开您的 cmd,导航到您的项目目录

cd into android

然后 运行

./gradlew clean

然后重新运行 应用程序或安装您想要的软件包,如图标之一!并尝试

npx react-native run-android

应该会有帮助;

否则,看到这个link并按照步骤安装multi dex,然后重复上述步骤!

as a Side Note: you should! update android studio, plugins and rebuild the app with latest android and Gradle