본문 바로가기
*오류해결

A problem occurred evaluating project ':app' 오류

by yun5o 2023. 2. 16.

npm run android 프로젝트명 을 실행하니 처음에는 잘 실행되나 싶었으나 오류가 발생했습니다.

FAILURE: Build failed with an exception.                                                                                                                                   
                                                                                                                                                                           
* Where:                                                                                                                                                                   
Build file 'D:\app\weightLog\andro id\app\build.gradle' line: 1                                                                                                            
                                                                                                                                                                           
* What went wrong:                                                                                                                                                         
A problem occurred evaluating project ':app'.                                                                                                                              
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 29s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: D:\app\weightLog\node_modules\react-native-gradle-plugin\src\main\java\com\facebook\react\codegen\generator\SchemaJsonParser.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

.
.
.

BUILD FAILED in 3m 46s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 3m 46s

    at makeError (D:\app\weightLog\node_modules\execa\index.js:174:9)
    at D:\app\weightLog\node_modules\execa\index.js:278:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async runOnAllDevices (D:\app\weightLog\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
    at async Command.handleAction (D:\app\weightLog\node_modules\@react-native-community\cli\build\index.js:192:9)
info Run CLI with --verbose flag for more details.

 

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

 

Gradle 7.0.0 대 버전은 Java 11 버전을 사용해야 한다고 합니다.

 

[JAVA] 자바8에서 자바11로 버전 변경하기

기존에 자바8을 사용하고 있었는데 새로 만들려는 프로젝트가 자바11로 변경되어 버전 변경이 필요해졌습니다. * 자바11 설치 Download the Latest Java LTS Free Subscribe to Java SE and get the most comprehensive Java

yun5o.tistory.com

Java 1.8을 Java 11로 버전업 하고 실행하면 정상적으로 실행됩니다.

댓글