Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure Build / Gradle Sync on freshly installed React Native 0.73.1[馃悰] #2257

Open
RakaDoank opened this issue Dec 25, 2023 · 4 comments

Comments

@RakaDoank
Copy link

RakaDoank commented Dec 25, 2023

Description

I actually have existing project with RN 0.73.1, and want to use this library, but the build process in Android or the Gradle Sync in Android Studio was failed.

I tried freshly installing the RN, and it is still failed.

How to repeat issue and example

  • Fresh React Native install npx react-native@latest init AwesomeProject
  • npm run start
  • Press a key

info Opening app on Android...
info A dev server is already running for this project on port 8081.
info Installing the app...
Task :gradle-plugin:pluginDescriptors
Task :gradle-plugin:processResources
Task :gradle-plugin:compileKotlin
Task :gradle-plugin:compileJava NO-SOURCE
Task :gradle-plugin:classes
Task :gradle-plugin:jar
Task :gradle-plugin:inspectClassesForKotlinIC
IOException: https://dl.google.com/android/repository/addons_list-5.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-4.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-3.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-2.xml
java.net.ConnectException: Connection refused: connect
IOException: https://dl.google.com/android/repository/addons_list-1.xml
java.net.ConnectException: Connection refused: connect
Failed to download any source lists!
IO exception while downloading manifest:
java.net.ConnectException: Connection refused: connect
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/java.net.Socket.connect(Socket.java:583)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:592)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:590)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.base/sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:589)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:633)
at java.base/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1287)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:245)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.downloadAndCache(DownloadCache.java:622)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openCachedUrl(DownloadCache.java:545)
at com.android.sdklib.repository.legacy.LegacyDownloader.downloadAndStream(LegacyDownloader.java:82)
at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadAndStream(LocalFileAwareDownloader.java:51)
at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:138)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

IO exception while downloading manifest:
java.net.ConnectException: Connection refused: connect
at java.base/sun.nio.ch.Net.connect0(Native Method)
at java.base/sun.nio.ch.Net.connect(Net.java:579)
at java.base/sun.nio.ch.Net.connect(Net.java:568)
at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:593)
at java.base/java.net.Socket.connect(Socket.java:633)
at java.base/java.net.Socket.connect(Socket.java:583)
at java.base/sun.net.NetworkClient.doConnect(NetworkClient.java:183)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:533)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:592)
at java.base/sun.net.www.http.HttpClient$1.run(HttpClient.java:590)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
at java.base/sun.net.www.http.HttpClient.privilegedOpenServer(HttpClient.java:589)
at java.base/sun.net.www.http.HttpClient.openServer(HttpClient.java:633)
at java.base/sun.net.www.protocol.https.HttpsClient.(HttpsClient.java:266)
at java.base/sun.net.www.protocol.https.HttpsClient.New(HttpsClient.java:380)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(AbstractDelegateHttpsURLConnection.java:193)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1287)
at java.base/sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1128)
at java.base/sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:179)
at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:142)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:245)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.downloadAndCache(DownloadCache.java:622)
at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openCachedUrl(DownloadCache.java:545)
at com.android.sdklib.repository.legacy.LegacyDownloader.downloadAndStream(LegacyDownloader.java:82)
at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadAndStream(LocalFileAwareDownloader.java:51)
at com.android.repository.impl.manager.RemoteRepoLoaderImpl.lambda$fetchPackages$0(RemoteRepoLoaderImpl.java:138)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)

Still waiting for package manifests to be fetched remotely.
5 actionable tasks: 5 executed

info 馃挕 Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong:
    Could not determine the dependencies of task ':react-native-image-picker:generateDebugRFile'.
    Failed to find Platform SDK with path: platforms;android-33
  • 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 23s
info Run CLI with --verbose flag for more details.
info Stopping server

Solution

What needs to be done to address this issue?
I actually do not know. Do i have to downgrade the SDK version or the React Native version itself?

Additional Information

  • Image Picker version: 7.1.0
  • React Native version: 0.73.1
  • Platform: Android
  • Development Operating System: Windows 11
  • Dev tools: Android Studio Hedgehog | 2023.1.1 minSdkVersion 21 compileSdkVersion = 34 targetSdkVersion = 34 ndkVersion = "25.1.8937393" buildToolsVersion = "34.0.0"
@UchihaSV
Copy link

Same here, latest react-native-image-picker not compile on last react-native with newArchEnabled, i'm use windows build with api 33 and change version of ndk as answered in same closed issue, not help i think because not m1.

Errors:
`Note: C:\project\node_modules\react-native-image-picker\android\src\main\java\com\imagepicker\Utils.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\project\node_modules\react-native-vector-icons\android\src\newarch\java\com\oblador\vectoricons\VectorIconsModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: C:\project\node_modules\react-native-safe-area-context\android\src\fabric\java\com\th3rdwave\safeareacontext\InsetsChangeEvent.kt: (7, 16): Redeclaration: InsetsChangeEvent
e: C:\project\node_modules\react-native-safe-area-context\android\src\fabric\java\com\th3rdwave\safeareacontext\UIManagerHelperCompat.kt: (8, 1): Conflicting overloads:
public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: C:\project\node_modules\react-native-safe-area-context\android\src\fabric\java\com\th3rdwave\safeareacontext\UIManagerHelperCompat.kt: (12, 1): Conflicting overloads: public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: C:\project\node_modules\react-native-safe-area-context\android\src\paper\java\com\th3rdwave\safeareacontext\InsetsChangeEvent.kt: (9, 16): Redeclaration: InsetsChangeEvent
e: C:\project\node_modules\react-native-safe-area-context\android\src\paper\java\com\th3rdwave\safeareacontext\UIManagerHelperCompat.kt: (9, 1): Conflicting overloads: public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getReactContext(view: View): ReactContext defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: C:\project\node_modules\react-native-safe-area-context\android\src\paper\java\com\th3rdwave\safeareacontext\UIManagerHelperCompat.kt: (18, 1): Conflicting overloads:
public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt, public fun getSurfaceId(context: Context): Int defined in com.th3rdwave.safeareacontext in file UIManagerHelperCompat.kt
e: file:///C:/project/node_modules/react-native-screens/android/src/fabric/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt:13:16 Redeclaration: FabricEnabledViewGroup
e: file:///C:/project/node_modules/react-native-screens/android/src/paper/java/com/swmansion/rnscreens/FabricEnabledViewGroup.kt:7:16 Redeclaration: FabricEnabledViewGroup

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':react-native-safe-area-context:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

  • 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:
    Execution failed for task ':react-native-screens:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details

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

BUILD FAILED in 55s`

When uninstall react-native-image-picker and newArchEnabled to false and install react-native-image-crop-picker then build success

@VivienTournie
Copy link

VivienTournie commented Dec 30, 2023

Same error here with RN 0.73.1.

Installation and build were OK until I set newArchEnabled to true inside android/gradle.properties

@mclbdn
Copy link

mclbdn commented Feb 1, 2024

same issue here

@AlejandroAguilar99
Copy link

Same error here with RN 0.73.1.

Installation and build were OK until I set newArchEnabled to true inside android/gradle.properties

The exact same thing happened to me, everything worked great until I set newArchEnabled as true, did you managed to solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants