joltup / rn-fetch-blob

A project committed to making file access and data transfer easier, efficient for React Native developers.
MIT License
2.81k stars 770 forks source link

Failing to download rn-fetch-blob 0.12.0 #777

Open sayurimizuguchi opened 2 years ago

sayurimizuguchi commented 2 years ago

JCenter was shut down and often has issues downloading the dependencies. We need the release of 0.13+ to have this commit https://github.com/joltup/rn-fetch-blob/commit/bb6cb9294d1e5501866bd4835252ab764394e92b

Currently when downloading version 0.12.0 and trying to build, we are experiencing:

A problem occurred configuring project ':rn-fetch-blob'.
> Could not resolve all files for configuration ':rn-fetch-blob:classpath'.
   > Could not resolve com.android.tools.analytics-library:shared:26.2.1.
     Required by:
         project :rn-fetch-blob > com.android.tools.build:gradle:3.2.1
         project :rn-fetch-blob > com.android.tools.build:gradle:3.2.1 > com.android.tools.build:builder:3.2.1
         project :rn-fetch-blob > com.android.tools.build:gradle:3.2.1 > com.android.tools.build:builder:3.2.1 > com.android.tools.analytics-library:tracker:26.2.1
      > Could not resolve com.android.tools.analytics-library:shared:26.2.1.
         > Could not get resource 'https://jcenter.bintray.com/com/android/tools/analytics-library/shared/26.2.1/shared-26.2.1.pom'.
            > Could not HEAD 'https://jcenter.bintray.com/com/android/tools/analytics-library/shared/26.2.1/shared-26.2.1.pom'.
               > Read timed out

Any news on when we will be releasing the new version?

If anybody is experiencing this as well, as a workaround, I have pointed my package.json to download the beta from Source code of your git directly:

    "rn-fetch-blob": "https://github.com/joltup/rn-fetch-blob/archive/refs/tags/v0.13.0-beta-1.tar.gz",
quicksilverr commented 2 years ago

But I'm facing this error then,

> Task :app:mergeDebugNativeLibs FAILED
w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

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.9/userguide/command_line_interface.html#sec:command_line_warnings
270 actionable tasks: 244 executed, 26 up-to-date
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/@react-native-async-storage/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: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native-localization/android/src/main/java/com/babisoft/ReactNativeLocalization/ReactNativeLocalization.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 or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/VirtualView.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.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
      - /Users/symplrr/.gradle/caches/transforms-3/a21ceb2dee016b3bc178279e85108ab3/transformed/jetified-react-native-0.66.2/jni
      - /Users/symplrr/.gradle/caches/transforms-3/d24bc87035947bcae59d7ee8279e9ad3/transformed/jetified-PdfiumAndroid-1.0.1/jni
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

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

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
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/@react-native-async-storage/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: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/@react-native-async-storage/async-storage/android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native-localization/android/src/main/java/com/babisoft/ReactNativeLocalization/ReactNativeLocalization.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 or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/symplrr/Desktop/Projects/ReactNative Projects/zonofi/node_modules/react-native-svg/android/src/main/java/com/horcrux/svg/VirtualView.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.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
   > 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
      - /Users/symplrr/.gradle/caches/transforms-3/a21ceb2dee016b3bc178279e85108ab3/transformed/jetified-react-native-0.66.2/jni
      - /Users/symplrr/.gradle/caches/transforms-3/d24bc87035947bcae59d7ee8279e9ad3/transformed/jetified-PdfiumAndroid-1.0.1/jni
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

* 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
quicksilverr commented 2 years ago

Found the fix for it..

you need to add this in your android/app/build.gradle

android {
    packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
   }
//rest of code here

}
sayurimizuguchi commented 2 years ago

Note, this issue is because of JCenter getting offline sometimes, it messes with multiple packages, not only this one. The workaround is to point to MavenCentral.

Full explanation: https://stackoverflow.com/questions/70746440/could-not-resolve-org-webkitandroid-jsc/70747328#70747328

SteveLai524 commented 1 year ago

Found the fix for it..

you need to add this in your android/app/build.gradle

android {
    packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
   }
//rest of code here

}

Yep, I solve the same problem by this.