React Native run-android build fails - android

I've followed the setup guide for react-native android on Mac OS X. I have the emulator running. When I run react-native run-android I get the following:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find any matches for com.android.support:appcompat-v7:23.0.+ as no versions of com.android.support:appcompat-v7 are available.
Searched in the following locations:
file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/maven-metadata.xml
file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/
https://jcenter.bintray.com/com/android/support/appcompat-v7/maven-metadata.xml
https://jcenter.bintray.com/com/android/support/appcompat-v7/
Required by:
fuckoff:app:unspecified
> Could not find com.android.support:appcompat-v7:22.2.0.
Searched in the following locations:
file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom
file:/Users/hugo/.m2/repository/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/22.2.0/appcompat-v7-22.2.0.jar
Required by:
fuckoff:app:unspecified > com.facebook.react:react-native:0.11.0
> Could not find com.android.support:support-v4:21.0.3.
Searched in the following locations:
file:/Users/hugo/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
file:/Users/hugo/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
https://jcenter.bintray.com/com/android/support/support-v4/21.0.3/support-v4-21.0.3.jar
Required by:
fuckoff:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:drawee:0.6.1
fuckoff:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:imagepipeline:0.6.1
I have all the necessary Android SDK packages installed including the build tools and the support repository. I'm noticing that it's looking for a directory in my home called .m2, which doesn't exist. I've never needed Maven to do android development. Do I need to install it to use react-native?

Just to be absolutely safe, I tried updating the android packages using android update sdk --no-ui.
Apparently the software I installed using android weren't the most up to date. Running the update fixed the issue.

Related

Sync failed - Could not find com.google.android.gms:play-services:9.4.0

I tried to run a project which was generated on someone else's PC, but sync fails and I get this error when cleaning the project:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.google.android.gms:play-services:9.4.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
https://jcenter.bintray.com/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/android/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/android/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/google/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.pom
file:/C:/Users/win7/AppData/Local/Android/sdk1/extras/google/m2repository/com/google/android/gms/play-services/9.4.0/play-services-9.4.0.jar
Required by:
Map:app:unspecified
was generated on someone other's PC on mine
They probably have the SDK repositories installed and you do not.
Seems like you are missing the Google Play Services Repository.

cordova /platforms/android/gradlew: Command failed with exit code 1 Error output:

I HAVE THIS ERROR WITH cordova-onesignal-plugin installed
On build app in ionic
sudo ionic build android
sudo cordova build android
Error: /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 ':_debugCompile'.
Could not find any matches for com.google.android.gms:play-services-gcm:+ as no versions of com.google.android.gms:play-services-gcm are available.
Searched in the following locations:
repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/maven-metadata.xml
repo1.maven.org/maven2/com/google/android/gms/play-services-gcm/
jcenter.bintray.com/com/google/android/gms/play-services-gcm/maven-metadata.xml
jcenter.bintray.com/com/google/android/gms/play-services-gcm/
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/maven-metadata.xml
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-gcm/
Required by:
:android:unspecified
Could not find any matches for com.google.android.gms:play-services-analytics:+ as no versions of com.google.android.gms:play-services-analytics are available.
Searched in the following locations:
repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/maven-metadata.xml
repo1.maven.org/maven2/com/google/android/gms/play-services-analytics/
jcenter.bintray.com/com/google/android/gms/play-services-analytics/maven-metadata.xml
jcenter.bintray.com/com/google/android/gms/play-services-analytics/
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/maven-metadata.xml
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-analytics/
Required by:
:android:unspecified
Could not find any matches for com.google.android.gms:play-services-location:+ as no versions of com.google.android.gms:play-services-location are available.
Searched in the following locations:
repo1.maven.org/maven2/com/google/android/gms/play-services-location/maven-metadata.xml
repo1.maven.org/maven2/com/google/android/gms/play-services-location/
jcenter.bintray.com/com/google/android/gms/play-services-location/maven-metadata.xml
jcenter.bintray.com/com/google/android/gms/play-services-location/
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/maven-metadata.xml
file:/usr/local/Cellar/android-sdk/24.4.1_1/extras/android/m2repository/com/google/android/gms/play-services-location/
Required by:
:android:unspecified
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Try installing "Google Repository" under Preferences > Appearance & Behavior > System Settings > Android SDK > SDK Tools in your Android Studio. Worked for me.
From the Android Studio docs, you will see:
Google Repository Recommended. Includes local Maven repository for
Google libraries, which provide a variety of features and services for
your apps, such as Google sign-in, Google Maps, Games achievements and
leaderboards, and much more.
My bet is that this includes com.google.android.gms:play-services-gcm:+.

Ionic2 and Facebook Login: Errors in emulating android device after installing cordova-plugin-facebook4

I have an Ionic2 app that I was hoping to install cordova-plugin-facebook4 with and setup Facebook Login. I've followed a few tutorials like this one here but I am running into issues when I try to emulate an android build.
Here is the error message:
Error: /Users/mreiter/documents/photor/photor/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 ':_debugCompile'.
> Could not find com.android.support:support-v4:23.4.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
https://repo1.maven.org/maven2/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
https://jcenter.bintray.com/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
https://jcenter.bintray.com/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/support-v4/23.4.0/support-v4-23.4.0.jar
Required by:
:android:unspecified
:android:unspecified > com.facebook.android:facebook-android-sdk:4.14.1
> Could not find com.android.support:cardview-v7:23.4.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
https://repo1.maven.org/maven2/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
https://jcenter.bintray.com/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
https://jcenter.bintray.com/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/cardview-v7/23.4.0/cardview-v7-23.4.0.jar
Required by:
:android:unspecified
:android:unspecified > com.facebook.android:facebook-android-sdk:4.14.1
> Could not find com.android.support:customtabs:23.4.0.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/customtabs/23.4.0/customtabs-23.4.0.pom
https://repo1.maven.org/maven2/com/android/support/customtabs/23.4.0/customtabs-23.4.0.jar
https://jcenter.bintray.com/com/android/support/customtabs/23.4.0/customtabs-23.4.0.pom
https://jcenter.bintray.com/com/android/support/customtabs/23.4.0/customtabs-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/23.4.0/customtabs-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/android/m2repository/com/android/support/customtabs/23.4.0/customtabs-23.4.0.jar
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/customtabs/23.4.0/customtabs-23.4.0.pom
file:/Users/mreiter/Library/Android/sdk/extras/google/m2repository/com/android/support/customtabs/23.4.0/customtabs-23.4.0.jar
Required by:
:android:unspecified
:android:unspecified > com.facebook.android:facebook-android-sdk:4.14.1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Any help with this would be greatly appreciated.
I was experiencing this issue this morning. The following steps worked for me:
Started a clean Ionic 2 project
Added android platform & installed the ionic facebook wrapper as described in the docs.
Opened Android Studio, imported the project from platforms/android/
Let it load, but when it asks you to update Gradle select ignore for this project.
After that it'll 'strongly recommend' you to update Gradle, once again ignore it and it'll Android Studio will start running your Gradle and building out an APK.
You'll find that you can use ionic build android and it should work.
Also I removed all Android SDK's except Android 6.X.X (Marshmallow). Give it a try. Still not exactly sure what the issue was though.

Error build Android in Cordova: Unspecified required by?

I'm trying to build my app in Cordova 5.4 using cordova run android. I'm getting this:
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_debugCompile'.
> Could not find any version that matches com.android.support:support-v4:+.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/support/support-v4/maven-metadata.xml
https://repo1.maven.org/maven2/com/android/support/support-v4/
Required by:
:android:unspecified
I can't seem to track this one down. Look familiar?
Sorry, if this should be a comment but I don't have enough points yet to do so.
Please try to install Android Support Repository in the Android SDK Manager.
Then check whether this works
cordova build android --verbose
If it's successful,
cordova run android --verbose
Source:
https://github.com/AzureAD/azure-activedirectory-library-for-cordova/issues/6
Check for android-support-v4.jar in your project build path.

Failed to resolve dependencies .?

Hello i have just imported my android studio project from one pc to another one and when building it is showing the error , Unresolved dependencies detected while building project in offine mode . I have unchecked OFFLINE WORK in Gradle settings . After Unchecking it its now showing the error
A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:support-v4:23.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
Required by:
TheFlame:app:unspecified > com.android.support:appcompat-v7:22.2.0
TheFlame:app:unspecified > com.android.support:design:22.2.0
TheFlame:app:unspecified > com.android.support:recyclerview-v7:22.2.0
Could not find com.android.support:support-v4:23.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
https://jcenter.bintray.com/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/android/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.pom
file:/C:/Users/user/AppData/Local/Android/sdk1/extras/google/m2repository/com/android/support/support-v4/23.0.1/support-v4-23.0.1.jar
Required by:
TheFlame:app:unspecified > me.dm7.barcodescanner:zxing:1.8.3 > me.dm7.barcodescanner:core:1.8.3
can anyone please help me on this fast.
Similiar Issue
Make sure to update both "Android Support Repository" and "Android Support Library" in SDK Manager
And also ensure the Gradle Sync is completed in Android Studio.
Try this:
1) Open SDK Manager
2) Launch standalone SDK Manager
3) Extras and check update for Support Library
4) Install it
5) Sync Gradle

Categories

Resources