인프런 커뮤니티 질문&답변

이승언님의 프로필 이미지
이승언

작성한 질문수

배달앱 클론코딩 [with React Native]

네이버맵 연동하기

nmap 에뮬레이터 build 관련 오류입니다..

작성

·

507

·

수정됨

0

호스트 운영체제 : windows

react-native 버전 : 0.64

강의에 나온 대로 commit부분 참조해 패키지 변경도 하였으며
강의에서 추가적으로 말씀해주신 proguard부분도 변경하였습니다.


-keep class com.nomansland.gchatproject.BuildConfig{*};
위 부분이 제 코드에는 없었으나 추가하여 넣었습니다.


./gradlew clean && ./gradlew.bat 을 실행한 후

react-native run-android를 실행했으나..
아래와 같은 오류가 계속발생하는데 해결을 못해 질문드리게 되었습니다..


> GChatProject@0.0.1 android

> react-native run-android

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.

Jetifier found 1134 file(s) to forward-jetify. Using 8 workers...

info Starting JS server...

info Launching emulator...

error Failed to launch emulator. Reason: Emulator exited before boot..

warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.

info Installing the app...

> Configure project :react-native-flipper

WARNING:Software Components will not be created automatically for Maven publishing from Android Gradle Plugin 8.0. To opt-in to the future behavior, set the Gradle property android.disableAutomaticComponentCreation=true in the gradle.properties file or use the new publishing DSL.

WARNING:The specified Android SDK Build Tools version (30.0.2) is ignored, as it is below the minimum supported version (30.0.3) for Android Gradle Plugin 7.4.2.

Android SDK Build Tools 30.0.3 will be used.

To suppress this warning, remove "buildToolsVersion '30.0.2'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

> Task :app:checkDebugAarMetadata 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/userguide/command_line_interface.html#sec:command_line_warnings

10 actionable tasks: 2 executed, 8 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:

Execution failed for task ':app:checkDebugAarMetadata'.

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

> Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.

> Execution failed for JetifyTransform: C:\Users\asus\.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native\0.71.0-rc.0\7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543\react-native-0.71.0-rc.0-debug.aar.

> Java heap space

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

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:

Execution failed for task ':app:checkDebugAarMetadata'.

> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

> Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {artifactType=android-aar-metadata, com.android.build.api.attributes.BuildTypeAttr=debug, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.

> Execution failed for JetifyTransform: C:\Users\asus\.gradle\caches\modules-2\files-2.1\com.facebook.react\react-native\0.71.0-rc.0\7a7f5a0af6ebd8eb94f7e5f7495e9d9684b4f543\react-native-0.71.0-rc.0-debug.aar.

> Java heap space

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

at makeError (C:\Users\asus\GChatProject\node_modules\execa\index.js:174:9)

at C:\Users\asus\GChatProject\node_modules\execa\index.js:278:16

at processTicksAndRejections (node:internal/process/task_queues:96:5)

at async runOnAllDevices (C:\Users\asus\GChatProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)

at async Command.handleAction (C:\Users\asus\GChatProject\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details.


네이버맵에서 얻은 clientId도 넣었는데.. 혹시 제가 빼먹은게 있을까요..

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.nomansland.gchatproject">


  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.CAMERA"/>
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
  <uses-permission android:name="android.permission.VIBRATE"/>
  <uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

  
    <application
      android:name=".MainApplication"
      android:label="@string/app_name"
      android:icon="@mipmap/ic_launcher"
      android:roundIcon="@mipmap/ic_launcher_round"
      android:allowBackup="false"
      android:theme="@style/AppTheme">
      <meta-data
            android:name="com.naver.maps.map.CLIENT_ID"
            android:value="{발급받은 ClientID}" />
      <activity
        android:name=".MainActivity"
        android:label="@string/app_name"

 

답변 2

0

이승언님의 프로필 이미지
이승언
질문자


댓글감사합니다..

npx react-native upgrade 0.66.5 <- 이 명령어를 사용해 변경하였으나 아래 결과를 내뱉고 실패하고 있었습니다..
처음부터 066.5버전을 받고 다시 프로젝트를 만드는게 맞는걸까요..?
------------------------------------------------------
PS C:\Users\asus\GChatProject> npx react-native upgrade 0.66.5

info Fetching diff between v0.66.4 and v0.66.5...

info Applying diff...

warn Excluding files that exist in the template, but not in your project:

- ios/GChatProject.xcworkspace/contents.xcworkspacedata

error Excluding files that failed to apply the diff:

- ios/GChatProject.xcodeproj/project.pbxproj

Please make sure to check the actual changes after the upgrade command is finished.

You can find them in our Upgrade Helper web app: https://react-native-community.github.io/upgrade-helper/?from=0.66.4&to=0.66.5

error Automatically applying diff failed. We did our best to automatically upgrade as many files as possible

warn Continuing after failure. Some of the files are upgraded but you will need to deal with conflicts manually

info Installing "react-native@0.66.5" and its peer dependencies...

error Command failed: yarn add react-native@0.66.5 react@17.0.2

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid

resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

warning react-native@0.66.5: Issues and pull requests filed against this version

are not supported. See the React Native release support policy to learn more: https://github.com/reactwg/react-native-releases#releases-support-policy

error Command failed.

Exit code: 128

Command: git

Arguments: ls-remote --tags --heads ssh://git@github.com/ZeroCho/react-native-naver-map.git

Directory: C:\Users\asus\GChatProject

Output:

Host key verification failed.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

yarn add v1.22.19

[1/4] Resolving packages...

[2/4] Fetching packages...

info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

.

Error: Command failed: yarn add react-native@0.66.5 react@17.0.2

warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid

resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.

warning react-native@0.66.5: Issues and pull requests filed against this version

are not supported. See the React Native release support policy to learn more: https://github.com/reactwg/react-native-releases#releases-support-policy

error Command failed.

Exit code: 128

Command: git

Arguments: ls-remote --tags --heads ssh://git@github.com/ZeroCho/react-native-naver-map.git

Directory: C:\Users\asus\GChatProject

Output:

Host key verification failed.

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

yarn add v1.22.19

[1/4] Resolving packages...

[2/4] Fetching packages...

info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

at makeError (C:\Users\asus\GChatProject\node_modules\execa\index.js:174:9)

at C:\Users\asus\GChatProject\node_modules\execa\index.js:278:16

at processTicksAndRejections (node:internal/process/task_queues:96:5)

at async installDeps (C:\Users\asus\GChatProject\node_modules\@react-native-community\cli\build\commands\upgrade\upgrade.js:219:3)

at async Object.upgrade [as func] (C:\Users\asus\GChatProject\node_modules\@react-native-community\cli\build\commands\upgrade\upgrade.js:359:9)

at async Command.handleAction (C:\Users\asus\GChatProject\node_modules\@react-native-community\cli\build\index.js:192:9)

info Run CLI with --verbose flag for more details.


제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

https://react-native-community.github.io/upgrade-helper/

이 사이트 따라서 버전간 차이점을 코드에 반영하시거나 프로젝트를 새로 만드시는 게 낫습니다.

0

이승언님의 프로필 이미지
이승언
질문자

아래는 npx react-native info 명령어 결과입니다.

66.5로 변경하면 된다는 stackoverflow글을 보고 변경했으나 아직해결되지 않고있습니다... 아이고..

System:

OS: Windows 10 10.0.19045

CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz

Memory: 6.59 GB / 15.70 GB

Binaries:

Node: 16.17.0 - C:\Program Files\nodejs\node.EXE

Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD

npm: 8.15.0 - C:\Program Files\nodejs\npm.CMD

Watchman: Not Found

SDKs:

Android SDK: Not Found

Windows SDK: Not Found

IDEs:

Android Studio: Not Found

Visual Studio: 17.5.33530.505 (Visual Studio Community 2022)

Languages:

Java: 11.0.16.1 - C:\Program Files\Microsoft\jdk-11.0.16.101-hotspot\bin\javac.EXE

npmPackages:

@react-native-community/cli: Not Found

react: 17.0.2 => 17.0.2

react-native: 0.66.5 => 0.66.4

react-native-windows: Not Found

npmGlobalPackages:

react-native: Not Found

제로초(조현영)님의 프로필 이미지
제로초(조현영)
지식공유자

0.66.5로 바꾸는 게 해결책 맞습니다. 바꿀 때 어떻게 바꾸셨나요?

이승언님의 프로필 이미지
이승언

작성한 질문수

질문하기