Recently, I changed my computer. I installed the react native environment again, and I had to import the previous projects. I encountered some small holes in the process of guiding the projects, and they were all solved. Let’s record them here
First, apply CD to the project through CMD and run the command
react-native run-android
I’m determined to make a mistake in guiding the project. The first error is the location of the SDK. The SDK installed on the previous computer is different from that installed on this computer
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory 'F:\AndroidSDK\AndroidSDK' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Solution:
This is the problem of configuration files, which can be easily solved by making good use of Android studio
First, open Android studio and click open
Find the Android under your project and click OK
Android studio will automatically identify your configuration problems and help you fix them
You can also change the location of the SDK manually
Continue react native run Android and find the continue error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:incrementalDebugJavaCompilationSafeguard'.
> java.io.IOException: Could not delete path 'D:\RN\react_native_workspace\AwesomeProject2\android\app\build\intermediates\classes\debug\android\support'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Said it couldn’t remove D:: RN \ \ react_ native_ We will enter your project Android App build intermediates classes and delete the debug file manually
If you continue to react native run Android, there may be errors. They are all related to configuration in the debug file. Continue to delete the debug file and run it again. I operated 4 ~ 5 times, and finally the project was successfully installed
Similar Posts:
- How to Solve React-native-gesture-handler Error
- Android ERROR: This version of Android Studio cannot open this project, please retry with Android Studio 3.6 or newer.
- Initialization of react native Android [How to Solve]
- Could not find com.android.tools.build:gradle:3.3.0.
- Android Run App Warning: The application could not be installed: INSTALL_FAILED_TEST_ONLY
- Flutter: Android dependency ‘com.android.support:support-v4’ has different version …
- Execution failed for task ‘:app:checkDebugDuplicateClasses‘.
- Eact Native Generate APP: You have not accepted the license agreements of the following SDK components:
- Using react native elements in RN project to report an error: unrecognized font family ‘material icons’