app:mergeExtDexDebug FAILED error해결하기

Maliethy·2021년 2월 5일
0

React-Native Error

목록 보기
4/15

1. issue

1) 회사컴에서는 잘돌아가던 npm run android가 집에 와서 돌려보니 다음의 에러가 발생했다.

> Task :app:mergeExtDexDebug FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
127 actionable tasks: 126 executed, 1 up-to-date

생략

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > java.nio.file.NoSuchFileException: C:\Users\user\momo\react-native\easyShop\android\app\build\intermediates\external_file_lib_dex_archives\debug\out

2) debug를 기록하는 log가 가득차서 발생한 에러로
Deprecated Gradle features were used in this build, making it incompatible with Gradle 5.0
에 나온 방법에 따라 다음과 같이 android/bundle.gradle 파일에서 gradle의 버전을 올려주었더니 에러 메세지가 바뀌었다.

       dependencies {
      -  classpath("com.android.tools.build:gradle:3.5.3")
      +  classpath("com.android.tools.build:gradle:4.0.1")
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}
> Task :app:stripDebugDebugSymbols FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
163 actionable tasks: 163 executed
Daemon will be stopped at the end of the build after running out of JVM memory
Note: C:\Users\user\momo\react-native\easyShop\node_modules\@react-native-community\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\user\momo\react-native\easyShop\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\NodesManager.java uses or overrides a deprecated 
API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\user\momo\react-native\easyShop\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\NodesManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: C:\Users\user\momo\react-native\easyShop\android\app\src\debug\java\com\easyshop\ReactNativeFlipper.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No version of NDK matched the requested version 21.0.6113669. Versions available locally: 22.0.7026061

2. solution

android studio의 configure> sdk manager로 들어가서 sdk tools 탭을 선택하면 npk(side by side)항목이 보인다.
체크박스에 체크한 후 오른쪽 아래에 있는 show package details 체크박스를 표시하면 android sdk build-tools라는 항목 밑으로 버전들이 나열되어있다.
거기서 에러메세지에 적힌 대로 version 21.0.6113669를 체크하고 apply해서 설치해주었더니 오류가 해결되었다.

다시 이런 오류가 발생하지 않도록 Execution failed for task ':app:mergeExtDexDebug' 오류 해결방법에 설명된 대로
build.gradle에 multiDexEnabled true로 설정한다.

 android { 
                ... 
 
 defaultConfig { 
 
         multiDexEnabled true 
         
                ...
                
               } 
         }
profile
바꿀 수 있는 것에 주목하자

0개의 댓글