• 카테고리

    질문 & 답변
  • 세부 분야

    모바일 앱 개발

  • 해결 여부

    해결됨

빌드 에러

23.02.13 19:35 작성 조회수 1.26k

0

Failed to construct transformer:  Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at stableHash (C:\Users\user\Food-Delivery-App\front\node_modules\metro-cache\src\stableHash.js:19:8)
    at Object.getCacheKey (C:\Users\user\Food-Delivery-App\front\node_modules\metro-transform-worker\src\index.js:593:7)
    at getTransformCacheKey (C:\Users\user\Food-Delivery-App\front\node_modules\metro\src\DeltaBundler\getTransformCacheKey.js:24:19)
    at new Transformer (C:\Users\user\Food-Delivery-App\front\node_modules\metro\src\DeltaBundler\Transformer.js:48:9)
    at C:\Users\user\Food-Delivery-App\front\node_modules\metro\src\Bundler.js:22:29
    at runNextTicks (node:internal/process/task_queues:60:5)
    at process.processTimers (node:internal/timers:504:9) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

파일을 옮기다가 에러가 났는데 몇 시간째 해결 못해서 결국 여기서 여쭤봅니다ㅠㅠ

npm run android 실행 결과 이 에러가 발생했습니다.

서칭 결과, 이 에러가 node 버전 문제라고 해서 다운그레이딩 시켜서 해봤으나 해결되지 않았어요

이 전에 다른 에러로 찾고 있다가 npm install -g npm@latest 로 했더니 해결 됐었거든요 그래서 npm이랑 node 버전을 다 다운그레이딩 했는데 안됐습니다

혹시 다른 방법이 있을까요???

 

답변 1

답변을 작성해보세요.

0

노드 16버전에서는 발생하지 않는 문제입니다. 노드17버전에서부터 발생합니다.

https://www.google.com/url?sa=t&source=web&rct=j&url=https://stackoverflow.com/questions/69394632/webpack-build-failing-with-err-ossl-evp-unsupported&ved=2ahUKEwjPnMzA85P9AhWNDd4KHfbCCrcQFnoECAoQAQ&usg=AOvVaw0wC224ZGAACOLLl1cayRWx

정이님의 프로필

정이

2023.02.21

C:\Users\user\Food-Delivery-App\front>npm run android

> fooddeliveryapp@1.0.1 android
C:\Users\user\Food-Delivery-App\front>npm run android

> fooddeliveryapp@1.0.1 android
> react-native run-android

info Starting JS server...
info Installing the app...

> Configure project :app
Reading env from: .env

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
5 actionable tasks: 5 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.       
   > Could not resolve project :react-native-code-push.
     Required by:
         project :app
      > No matching configuration of project :react-native-code-push was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1' but:
          - None of the consumable configurations have attributes.

* 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 13s

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.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.       
   > Could not resolve project :react-native-code-push.
     Required by:
         project :app
      > No matching configuration of project :react-native-code-push was found. The consumer was configured to find an API of a component, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '7.3.1' but:
          - None of the consumable configurations have attributes.

* 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 13s

    at makeError (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

이 후 이것도 해보고 저것도 해보고 돌고 돌다보니 다시 이 에러가 생겼습니다.

 

앞의 수업을 바탕으로 노드 16.13.1 버전으로 다운그레이드해서 빌드를 진행했으나, 상황은 같습니다..

https://code-hoon.tistory.com/238
https://velog.io/@seora/RN-%EC%97%90%EB%9F%AC-run-android-build-error
위 블로그 에러와 같은 상황인데, sdk 환경변수 문제라고 하는데 제가 보기엔 문제가 없어보여서 어디가 문제인지 모르겠어요

imageimage

 

이 에러는 제가 공지사항에 올린 0.71 레포 코드 참고하세요. android 폴더 내부 파일들 중에 code-push 관련된 설정을 빠뜨리신 겁니다.

블로그에 있는 에러랑 전혀 다른 에러입니다. 에러 텍스트 자체가 다릅니다. 구분하실 줄 아셔야 합니다

정이님의 프로필

정이

2023.02.21

C:\Users\user\Food-Delivery-App\front>npm run android

> fooddeliveryapp@1.0.1 android
> react-native run-android

info Starting JS server...
info Installing the app...

> Configure project :app
Reading env from: .env
WARNING:The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.3.1.
Android SDK Build Tools 30.0.3 will be used.
To suppress this warning, remove "buildToolsVersion '28.0.3'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDebugDuplicateClasses FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.     

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
277 actionable tasks: 8 executed, 269 up-to-date

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform com.skt.Tmap_1.75.jar to match attributes {artifactType=enumerated-runtime-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: C:\Users\user\Food-Delivery-App\front\android\app\libs\com.skt.Tmap_1.75.jar.
         > Transform's input file does not exist: C:\Users\user\Food-Delivery-App\front\android\app\libs\com.skt.Tmap_1.75.jar. (See https://issuetracker.google.com/issues/158753935)

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 11s

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 completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform com.skt.Tmap_1.75.jar to match attributes {artifactType=enumerated-runtime-classes, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JetifyTransform: C:\Users\user\Food-Delivery-App\front\android\app\libs\com.skt.Tmap_1.75.jar.
         > Transform's input file does not exist: C:\Users\user\Food-Delivery-App\front\android\app\libs\com.skt.Tmap_1.75.jar. (See https://issuetracker.google.com/issues/158753935)

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 11s

    at makeError (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
    at C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async runOnAllDevices (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:82:7)
    at async Command.handleAction (C:\Users\user\Food-Delivery-App\front\node_modules\@react-native-community\cli\build\index.js:108:9)
info Run CLI with --verbose flag for more details.

rn71 레포 참고해서 수정하였습니다.

이번엔 또 다른 에러가 발생했네요...ㅠㅠ

build.gradle, patches 파일 추가해주었고, AndroidManifest.xml true로 다 변경해주었습니다. 이후 npm i 했구요

C:\Users\user\Food-Delivery-App\front\android\app\libs\com.skt.Tmap_1.75.jar.

이 파일이 없나요?? Add as library도 하셨나요?

정이님의 프로필

정이

2023.02.21

파일이 없습니다 아직 그 부분 수업을 듣지 못했습니다ㅜㅜ

음... 진도를 어디까지 나가신건가요? 처음에 code-push 에러는 수업 완전 마지막 부분입니다. tmap 부분은 중간 정도이고요. 너무 후반부 소스 코드를 쓰신 게 아닌가 싶습니다.