React Nativeのビルドエラー(Could not determine the dependencies of task ‘:app:mergeDebugAssets’.)について

対あり技術部(技術系)

問題

React Nativeでパッケージをがちゃがちゃいじっていたらエラーでビルドができなくなってしまった

以下は、「react-native run-android」実行時のエラー内容である。

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 app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not resolve org.webkit:android-jsc:+.
     Required by:
         project :app
      > Failed to list versions for org.webkit:android-jsc.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/org/webkit/android-jsc/maven-metadata.xml.
            > Could not HEAD 'https://jcenter.bintray.com/org/webkit/android-jsc/maven-metadata.xml'.
               > Read timed out
   > Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
     Required by:
         project :app > com.facebook.react:react-native:0.64.1
      > Skipped due to earlier error
   > Could not resolve com.squareup.okhttp3:okhttp-urlconnection:3.12.12.
     Required by:
         project :app > com.facebook.react:react-native:0.64.1
      > Skipped due to earlier error
   > Could not resolve com.squareup.okio:okio:1.17.5.
     Required by:
         project :app > com.facebook.react:react-native:0.64.1
      > Skipped due to earlier error
   > Could not resolve com.squareup.okhttp3:okhttp:3.12.12.
     Required by:
         project :app > com.facebook.react:react-native:0.64.1 > com.facebook.fresco:imagepipeline-okhttp3:2.0.0
      > Skipped due to earlier error

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

解決方法

gradlew clean」をした後に、「react-native run-android」をすることで治りました。

% cd android #プロジェクトディレクトリにいる想定
% ./gradlew clean

コメント

タイトルとURLをコピーしました