Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio building errors using react native app

I have been trying to create an app using react native using expo tools xde and then detach it using exp detach, when I open in Android Studio I get quite many error when building like:

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'.

Is this normal? you could ask me why did you detach, well for that I have reasons.

How can create a detach app in react native and have a bit smoother experience when it comes to compiling building the app in android studio?

ps: I am using Android Studio 3.1.1 and I somehow seem to be using latest version of Gradle [https://services.gradle.org/distributions/gradle-4.4-all.zip][1], idk if this comes from the prespective of the react app or I have somehow updated thru Android studio.

Also I do not seem to have anymore compile on my dependencies in app.build.graddle and it is still complaining about it I subtstituted with implementation already

like image 445
Mizlul Avatar asked Apr 13 '18 08:04

Mizlul


People also ask

Is Android Studio good for React Native?

You will need Node, Watchman, the React Native command line interface, a JDK, and Android Studio. While you can use any editor of your choice to develop your app, you will need to install Android Studio in order to set up the necessary tooling to build your React Native app for Android.

How do I fix React Native error?

What you need to do is install a earlier version of Gradle for your project and then rebuild your app. Go to https://developer.android.com/studio/releases/gradle-plugin. Scroll down to the Update Gradle section. Here, you will see a table of Gradle version and Plugin version.

Is Android Studio better than React Native?

When assessing the two solutions, reviewers found Android Studio easier to use and administer. However, reviewers preferred the ease of set up, and doing business with React Native overall. Reviewers felt that Android Studio meets the needs of their business better than React Native.


1 Answers

As the error states, you have to replace compile with implementation in dependencies since compile is obsolete.

Example

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'
    ....
}
like image 142
alfredmack Avatar answered Sep 17 '22 14:09

alfredmack