f8app react-native run-android failed - android

I cloned git project https://github.com/fbsamples/f8app
I do all the instructions. But when I try to run the project (run-android) error occurs.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-fbsdk'.
> Could not resolve all dependencies for configuration ':react-native-fbsdk:_debugCompile'.
> Could not find com.android.support:appcompat-v7:25.0.0.
Searched in the following locations:
file:/Users/Mastermind/.m2/repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/Users/Mastermind/.m2/repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/Users/Mastermind/Desktop/ReactNative/f8app/node_modules/node_modules/react-native/android/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/Users/Mastermind/Desktop/ReactNative/f8app/node_modules/node_modules/react-native/android/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/Users/Mastermind/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/Users/Mastermind/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
file:/Users/Mastermind/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.pom
file:/Users/Mastermind/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/25.0.0/appcompat-v7-25.0.0.jar
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 20.189 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html

Related

Problem with cordova emulate android and Gradle

I'm new in android apps development. I created a new ionic project. When I try in the console cordova emualte android it fails with this errors:
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 resolve com.android.tools.build:gradle:2.3.0.
Required by:
project :
> Could not resolve com.android.tools.build:gradle:2.3.0.
> Could not get resource 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
> Could not GET 'https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom'.
> Connect to repo.maven.apache.org:443 [repo.maven.apache.org/151.101.4.215] failed: Connection timed out: connect
* 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 7s
I try curl https://repo.maven.apache.org/maven2/com/android/tools/build/gradle/2.3.0/gradle-2.3.0.pom in the console and worked.
Thanks for any help!!

Could not find com.android.support:appcompat-v7:27.1.1 | react-native-vector-icons

I was trying to compile location-saver that has a dependency react-native-vector-icons that I was not able to build.
The build was failing after a lot of attempts. Here is the log:
react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> A problem occurred configuring project ':react-native-vector-icons'.
> Could not resolve all dependencies for configuration ':react-native-vector-icons:_debugCompile'.
> Could not find com.android.support:appcompat-v7:27.1.1.
Searched in the following locations:
file:/Users/gureks/.m2/repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/.m2/repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Desktop/Github/reacting/location-saver/node_modules/react-native/android/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Desktop/Github/reacting/location-saver/node_modules/react-native/android/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
https://repo1.maven.org/maven2/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
file:/Users/gureks/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.pom
file:/Users/gureks/Library/Android/sdk/extras/google/m2repository/com/android/support/appcompat-v7/27.1.1/appcompat-v7-27.1.1.jar
Required by:
LocationSaver:react-native-vector-icons:unspecified > com.facebook.react:react-native:0.57.8
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 16.274 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html
I even changed the Support Library versions in the build.grade of the react-native-vector node_module.
Need help for a project, new to react-native.

FAILURE: Build failed with an exception React-native

FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-linear-gradient'.
Could not resolve all dependencies for configuration ':react-native-linear-gradient:_debugCompileCopy'.
Could not find com.android.support:appcompat-v7:26.1.0.
Searched in the following locations:
file:/Users/omkaryadav/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.pom
file:/Users/omkaryadav/Library/Android/sdk/extras/android/m2repository/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
file:/Users/omkaryadav/Documents/project/react/Archive/android/sdk-manager/com/android/support/appcompat-v7/26.1.0/appcompat-v7-26.1.0.jar
Required by:
project :react-native-linear-gradient > com.facebook.react:react-native:0.56.0
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 13.577 secs
You have to link 3rd party libraries before building your project. That specific library you can link automatically by running react-native link.
If you didn't already, run npm install before command above.

New dependency React native - gradle clean - could not resolve all dependencies

I've recently added a library to my react-native project. The project was running fine before adding this dependency. However, when I try tryi to run it now through react-native run-android I get this error:
File C:\Users\user\.android\repositories.cfg could not be loaded.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApkCopy'.
> Could not find com.onesignal:OneSignal:23.0.1.
Required by:
project :app
> Could not find com.onesignal:OneSignal:23.0.1.
Required by:
project :app > project :react-native-onesignal
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1 mins 57.711 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Edit: The android emulator is of course running.
After doing som research I figured out that I could try npm uninstall and install, without success. In the build.gradle I have specified my onesignal_app_id, and compile 'com.onesignal:OneSignal:23.0.1' under dependencies. I therefore tried gradle clean which produced this error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugApk'.
> A problem occurred configuring project ':react-native-onesignal'.
> Failed to notify project evaluation listener.
> com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 1s
I had similar problem with Cordova.
I fixed by changing version of gradle from 2.2.3 to 2.3.3.
Below oneliner for this:
sed -i -E 's/com.android.tools.build:gradle:2.2.[0-9]+/com.android.tools.build:gradle:2.3.3/g' build.gradle

react-native run-android Could not resolve all dependencies for configuration ':classpath'

I am learing react-native,i got this error when i used command 'react-native run-android' on windows 10
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'demo'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not download gradle-core.jar (com.android.tools.build:gradle-core:1.3.1)
> Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
> Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle-core/1.3.1/gradle-core-1.3.1.jar'.
> peer not authenticated
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I'm tired,I'll be appreciate for you helping me!

Categories

Resources