react-native - 使用 React Native 应用程序构建 Android Studio 时出错

标签 react-native android-gradle-plugin build.gradle react-native-android android-studio-3.1

我一直在尝试使用 expo 工具 xde 使用 react native 创建一个应用程序,然后使用 exp detach 将其分离,当我在 Android Studio 中打开时,我在构建时遇到很多错误,例如:

Using incompatible plugins for the annotation processing

Configuration 'compile' is obsolete and has been replaced with
'implementation' and 'api'. It will be removed at the end of 2018.
For more information see:
http://d.android.com/r/tools/update-dependency-configurations.html


The specified Android SDK Build Tools version (23.0.1) is ignored,
as it is below the minimum supported version (27.0.3) for Android
Gradle Plugin 3.1.1. Android SDK Build Tools 27.0.3 will be used. To
suppress this warning, remove "buildToolsVersion '23.0.1'" from your
build.gradle file, as each version of the Android Gradle Plugin now
has a default version of the build tools. Update Build Tools version
and sync project Open File


Configuration 'compile' is obsolete and has been replaced with
'implementation' and 'api'. It will be removed at the end of 2018.
For more information see:
http://d.android.com/r/tools/update-dependency-configurations.html


Configuration 'testCompile' is obsolete and has been replaced with
'testImplementation' and 'testApi'. It will be removed at the end of
2018. For more information see: http://d.android.com/r/tools/update-dependency-configurations.html


Configuration 'testApi' is obsolete and has been replaced with
'testImplementation'.

这是正常的吗?你可以问我为什么分手,我有理由。

在 android studio 中编译构建应用程序时,如何在 React Native 中创建分离应用程序并获得更流畅的体验?

ps:我使用的是 Android Studio 3.1.1,不知何故,我似乎在使用最新版本的 Gradle [https://services.gradle.org/distributions/gradle-4.4-all.zip][1],如果有的话,idk从 react 应用程序的角度来看,或者我已经通过 Android Studio 以某种方式进行了更新。

此外,我似乎不再对 app.build.graddle 中的依赖项进行编译,它仍然在提示我已经用实现替换了它

最佳答案

由于错误状态,您必须替换 compileimplementation在依赖项中,因为 compile 已过时。

例子

dependencies {
    implementation 'com.android.support:support-v4:25.4.0'
    implementation 'com.android.support:recyclerview-v7:25.4.0'
    implementation 'com.android.support:design:25.4.0'
    ....
}

关于react-native - 使用 React Native 应用程序构建 Android Studio 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49812692/

相关文章:

android - 将项目从 Eclipse ADT 导入到 Android Studio 时,包 com.google.api.client.http.apache 不存在

javascript - 为什么我的 this.setState 不更新数组

reactjs - 一个标签导航器中的多个屏幕

javascript - react native TextInput ref 错误,焦点不是函数

android - 找不到参数的方法 classpath() [com.google.gms :google-services:3. 0.0]

android - 无法解决有关向后兼容库的问题

Android Gradle 库构建 : Include & exclude files from the jar inside the generated aar

android - Gradle同步在Android Studio 3.6.1中失败

android-studio - 从所有配置中排除多个传递依赖项

javascript - React Navigation - 如何从另一个文件调用函数并在 headerRight onPress 上使用它?