React Native suddenly throwing May 09 2022 - android

I am currently working on a React Native project that has been previously worked on by other devs. it was compiling fine as before May 09 2022 then I tried to compile it now and it's now throwing
BUILD FAILED in 41s
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'.
> Could not resolve com.facebook.android:facebook-android-sdk:9.0.+.
Required by:
project :app > project :react-native-fbsdk-next
> Failed to list versions for com.facebook.android:facebook-android-sdk.
> Unable to load Maven meta-data from https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml.
> Could not HEAD 'https://jcenter.bintray.com/com/facebook/android/facebook-android-sdk/maven-metadata.xml'.
> org.apache.http.client.ClientProtocolException (no error message)
No new packages were added, I even tried to revert to old commits just to confirm if it's package related and it still threw this error. Was there any changes or update with Maven recently? I have other devs that are on Mac and theirs seem to be compiling just fine

I am not an expert in react native, I only started using it and I also have the same issue from 9th may 2022. But I am able to fixed it.
You can follow the below steps and may be it will work for you too.
Open this file node_modules/react-native-fbsdk-next/android/build.gradle and change Line no 48 with below line
def FACEBOOK_SDK_VERSION = safeExtGet('facebookSdkVersion', '9.0.0')

Related

Flutter Error: Could not determine the dependencies of task ':app:compileDebugKotlin'

I got this error when I run my first flutter app in android studio. my emulator internet is connected and the airplane mode is off. I saw other similar question but none of them were like this error and they didn't help me. can anyone help me?
Launching lib\main.dart on sdk gphone x86 in debug mode...
Running Gradle task 'assembleDebug'...
Could not resolve compiler classpath. Check if Kotlin Gradle plugin repository is configured in project ':app'.
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugKotlin'.
> Could not resolve all files for configuration ':app:kotlinCompilerClasspath'.
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
Required by:
project :app > org.jetbrains.kotlin:kotlin-compiler-embeddable:1.3.50 > org.jetbrains.kotlin:kotlin-stdlib:1.3.50
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
> Could not get resource 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'.
> Could not GET 'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'. Received status code 403 from server: Forbidden
> Could not resolve org.jetbrains.kotlin:kotlin-stdlib-common:1.3.50.
> Could not get resource 'https://storage.googleapis.com/download.flutter.io/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'.
> Could not GET 'https://storage.googleapis.com/download.flutter.io/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom'. Received status code 403 from server: Forbidden
...
if more details are required please tell me. thanks.
this is happen to me several times
have you try to build the gradle
cd android
./gradlew build
it will show the error more detail

React Native Failed to build after Installing react-navigation and react-native-gesture-handler

I did the following
react-native init project-name
yarn add react-navigation react-native-gesture-handler and
react-native run-android
The dependencies installed successfully but the app failed to build with the following errors
> Task :react-native-gesture-handler:packageDebugResources FAILED
17 actionable tasks: 8 executed, 9 up-to-date
> FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:packageDebugResources'.
> Could not resolve all files for configuration ':react-native-gesture-handler:_
internal_aapt2_binary'.
> Failed to transform artifact 'aapt2-windows.jar (com.android.tools.build:aa
pt2:3.4.1-5326820)' to match attributes {artifactType=_internal-android-aapt2-bi
nary, org.gradle.usage=java-runtime-jars}.
> org.gradle.api.GradleException: Could not read path 'C:\Users\DevLewa\.g
radle\caches\transforms-2\files-2.1\3d408b3640f7dfba25695085d22596b0\aapt2-3.4.1
-5326820-windows'.
I have searched all through github issues but found no helping information, how do I resolve this, I have being on it since morning today.
Thanks
I had the same problem with some of my initialized projects using reac-native cli. it would be solved by running: react-native link in your project directory. I hope it would work for you as me.
If it was helpful please vote me up:)

Instruct gradle to use local files

I am trying to build an ionic 4 project for android with this command:
ionic cordova build android --verbose
The bulid fails with the following error:
Running command: /path/gradlew cdvBuildDebug -b /path/build.gradle
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.3.0.
Searched in the following locations:
- https://dl.google.com/path/gradle-3.3.0.pom
- https://dl.google.com/path/gradle-3.3.0.jar
...
When I do wget https://dl.google.com/path/gradle-3.3.0.pom I get 404.
When I paste the url into the addressbar of my browser however the file does get downloaded. So, I have been able to download the files gradle is having trouble downloading.
Is there a way I instruct gradle to use the local files instead of trying to download them?
i think this is for sanctions and if we can use vpn thats resolved

Ionic android build issue in linux

I have successfully installed cordova v6.3.1, ionic v2.0.0 and Android Studio
OS: Virtualbox (Xubuntu)
when i run ionic build android
I get below error:
BUILD FAILED
Total time: 7.749 secs
Error: /var/lib/mymachine/ionic-01/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> org.apache.http.ssl.SSLInitializationException: /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/security/cacerts (No such file or directory)
Few post suggested to install Android support repository and Google Repository. I installed it. But still i face the face problem.
I had the similar problem. In my case it was simple java webapp which was using gradle. This project used java 6. My java 6 was not installed properly. Thats why I had the below issue.
gradle was not able to find the /Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/lib/security/cacerts
This is a symlink to another file which was not present.
So I removed my jdk and re-installed it. That solved the problem.

Ionic build android throws `Could not resolve com.android.tools.build:gradle:2.1.0` on Ubuntu

This is my stacktrace after ionic build android, after the simple three steps to begin working with ionic:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:2.1.0.
Required by:
:android:unspecified
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
> Could not resolve com.android.tools.build:gradle:2.1.0.
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/2.1.0/gradle-2.1.0.pom'.
> sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
All the code is the default code coming with $ ionic start myApp tabs
I tried to change gradle version, update cordova.
I've also tried to add this lines in build.gradle:
repositories {
maven { url 'http://repo1.maven.org/maven2' }
}
I also did that, just in case:
When running the "Cordova build android" I'm getting the below exception
I had the same problem and I resolve it installing manually gradle.
https://gradle.org/gradle-download/
I made these commands:
curl -s https://get.sdkman.io | bash
sdk install gradle 2.1 # Changing 3.1 version to 2.1
I had to restart my computer to get the paths configured correctly.
Previously I checked that it was configured correctly java and his paths but I don't think it has been important to solve it.

Categories

Resources