The following error occurs when trying to build an android app with cordova and the cordova-crosswalk plugin:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
> 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/
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/maven-metadata.xml
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/com/android/support/support-v4/
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.
BUILD FAILED
Total time: 2.918 secs
/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/gradlew with args: cdvBuildDebug,-b,/home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/build.gradle,-PcdvBuildArch=arm,-Dorg.gradle.daemon=true
ERROR running one or more of the platforms: Error: /home/remi/dev/git/gitlab/sirap-sas/tereo-mobile/platforms/android/cordova/run: Command failed with exit code 1
You may not have the required environment or OS to run this project
Please notice that section:
Could not resolve all dependencies for configuration ':_armv7DebugCompile'.
It can happen because building an android project with the crosswalk plugin try to build two apks : one for ARM, the other for x86.
The solution is to install Android Support Repository :
Open the SDK manager (from command line, type android).
Under Extras, Make sure you have Android Support Repository and Google Repository downloaded.
Update answer
Seems starting from crosswalk 16, Android Support Repository and Google Repository is not enough.
You need to install Local Maven repository for Support Libraries from Extras as well.
for me Solution was:
i updated crosswalk to #15.44.384.13
ionic browser add crosswalk#15.44.384.13
then i changed config.xml:
<preference name="xwalkVersion" value="15+" />
cuz versions "16+" - "18+" not work for me
It may be the problem when you did not include google support respository and android support repository under extras. as well as when you not update the cordova with your cordova platform.because cordova and cordova platform must be use latest version.update your Cordova with npm update cordova -g --save and cordova platform with cordova platform update platform_name(like android).
This worked for me
1.goto platforms\android\cordova-plugin-crosswalk-webview folder
2.Open .gradle file
3.find
dependencies { compile xwalkSpec }
and replace with
dependencies {
compile 'org.xwalk:xwalk_core_library:22.52.561.4'
}
**
note: 22.52.561.4 is version of crasswalk on your machine
to know it , open ionic app , chrome://inspect then
window.navigator.userAgent
This will print some lines , copy xwalk details from there
I know it's a little late to add an answer. but I faced this issue for a long time and none of these steps fixed it. If your IP is from Iran, then you should build your project with VPN on. It seems that dependencies are banned for some countries.
Related
I faced the problem, more correct in gradle, when I enter the command - npx react-native run-android into the console - it gives me the following error :
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring root project 'Da'.
Could not resolve all artifacts for configuration ':classpath'.
Could not find com.android.tools.build:gradle:6.4.1.
Searched in the following locations>
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom -https://jcenter.bintray.com/com/android/tools/build/gradle/6.4.1/gradle-6.4.1.pom
Initially - the problem was incompatibility between gradle and android versions, but after i changed version of gradle and terminal automatically download new version into directory, first error disappeared, but i got another (current problem). I had try some advice before asking question in StackOverFlow, but they didn't work. Here some characteristics :
React-Native Doctor image
Gradle code : gradle.properties ,
gradle-wrapper.properties
Gradle Directory : Here
Path variables :Here
I appreciate all help (I think, that issue is in PATH, but not sure). By the way - does anyone know, how to add pictures without link?
You are confusing gradle with the gradle plugin.
The gradle plugin 6.4.1 doesn't exist.
Use the latest stable version:
classpath 'com.android.tools.build:gradle:4.2.2'
Check also the compatibility with the gradle version:
Plugin version Required Gradle version
4.0.0+ 6.1.1+
4.1.0+ 6.5+
4.2.0+ 6.7.1+
Hi I'm just starting to learn how to code on android studio.
After running npm run android on my terminal, I've faced some errors which I could not solve.
The error message is as follows :
XXXX-MacBook-Pro:first-app XXXX$ npm run android
first-app#0.1.0 android /Users/XXXX/Desktop/React Native/first-app
react-native run-android
Scanning folders for symlinks in /Users/XXXX/Desktop/React
Native/first-app/node_modules (8ms) Starting JS server... Building and
installing the app on the device (cd android && ./gradlew
installDebug)...
FAILURE: Build failed with an exception.
What went wrong: Could not resolve all files for configuration
':app:_internal_aapt2_binary'. Could not find
com.android.tools.build:aapt2:3.2.0-4818971. Searched in the
following locations:
file:/Users/XXXX/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/Users/XXXX/Library/Android/sdk/extras/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
file:/Users/XXXX/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/Users/XXXX/Library/Android/sdk/extras/google/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
file:/Users/XXXX/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/Users/XXXX/Library/Android/sdk/extras/android/m2repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
file:/Users/XXXX/.m2/repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/Users/XXXX/.m2/repository/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
https://jcenter.bintray.com/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
file:/Users/XXXX/Desktop/React Native/first-app/node_modules/react-native/android/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971.pom
file:/Users/XXXX/Desktop/React Native/first-app/node_modules/react-native/android/com/android/tools/build/aapt2/3.2.0-4818971/aapt2-3.2.0-4818971-osx.jar
Required by:
project :app
BUILD FAILED in 3s 11 actionable tasks: 1 executed, 10 up-to-date
Could not install the app on the device, read the error above for
details.
I hope you guys can help me with it.
I managed to fix this issue by adding a line google() to ~/my-app/android/build.gradle in the following section:
allprojects {
respositories{
google() //right here
}
}
Just a guess, but I believe it is a regression to do with the new Android Studio 3.2.0 release.
This is in react native which in fact i never used, this isn't an answer but i cant comment as my reputation is too low for that(pardon me). Have you installed android build tools? The ':app:_internal_aapt2_binary' is a configuration file that the system needs to compile the application which is a part of build tools.
If you are using android studio 3.0, then in gradle , change the dependency from
compile files('xyz')
to
implementation files('xyz')
[x] submitting bug
[x] Android platform react-native
[x] ubuntu 16.04 LTS
I am having issue in creating build by command react-native run-android
Here i am pasted error:
$ react-native run-android Scanning folders for symlinks in
/home/pct3/webroot/Hello/node_modules (39ms) 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 root project 'Hello'.
Could not resolve all files for configuration ':classpath'.
Could not resolve com.android.tools.build:gradle:3.0.1.
Required by:
project :
Could not resolve com.android.tools.build:gradle:3.0.1.
Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom'.
sun.security.validator.ValidatorException: No trusted certificate found
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 12s 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
Your help will save my day, if you need any extra information let me know.
Github link: Issue
a fast and easy solution to this issue is as following
1- open android/build.gradle
2-replace the gradle version with an older one for example 3.0.1
example of how it should look
classpath("com.android.tools.build:gradle:3.0.1")
and boom no more issues
Delete or rename the android folder and run react-native upgrade command.
Run npm install
Change your build.gradle so it follows this format:
You can see all available artifacts at Google's Maven repository index (see below for programmatic access).
To add one of these libraries to your build, include Google's Maven repository in your top-level build.gradle file:
allprojects {
repositories {
google()
// If you're using a version of Gradle lower than 4.1, you must instead use:
// maven {
// url 'https://maven.google.com'
// }
// An alternative URL is 'https://dl.google.com/dl/android/maven2/'
}
}
More info here https://developer.android.com/studio/build/dependencies
I just started with React native.
I've follow this article: https://facebook.github.io/react-native/docs/getting-started.html
I run my application with command: react-native run-android but it show an exception:
FAILURE: Build failed with an exception.
What went wrong: A problem occurred configuring root project
Could not resolve all dependencies for co
Could not resolve com.android.tools.bu
Required by:
:abcdefgg:unspecified
Could not resolve com.android.tools
Could not get resource 'https:// /build/gradle/1.3.1/gradle-1.3.1.pom'.
Could not GET 'https://jcente /gradle/1.3.1/gradle-1.3.1.pom'.
Connection to https://jcen
Try: Run with --stacktrace option to get the sta option to get more log output.
BUILD FAILED
How can i resolve this problem? I've read many articles here, Local Maven repository for Support Library has been installed in my computer.
Thanks very much!
I just solve this problem this morning.
If you noticed there is a list of dependencies map defined in settings.gradle inside android folder.
Here is what I did:
Go to android folder
Run this command ./gradlew installDebug --info
And then it will show a list of dependencies that android need. It also show which dependencies are not resolved.
In my case I'm lack of 'react-native-network-info' so all I need to do is npm install that package.
Maybe your situation will difference but I think this can help you.
In react-native this problem is due to flipper dependencies, it is solved by increasing its version to 0.105.0. (file: gradle.properties)
Problem while running the run-android. I was facing a problem, I guess it's dude to the gradle dependencies.
I have even tried sudo, which is giving some other random error saying $ANDROID_HOME. Which isn't the problem.
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'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not find com.android.support:appcompat-v7:23.0.0.
Searched in the following locations:
file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
Required by:
AwesomeProject:app:unspecified
> Could not find com.android.support:appcompat-v7:23.0.0.
Searched in the following locations:
file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
file:/Users/iraycd/.m2/repository/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.pom
https://jcenter.bintray.com/com/android/support/appcompat-v7/23.0.0/appcompat-v7-23.0.0.jar
Required by:
AwesomeProject: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/iraycd/.m2/repository/com/android/support/support-v4/21.0.3/support-v4-21.0.3.pom
file:/Users/iraycd/.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:
AwesomeProject:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:drawee:0.6.1
AwesomeProject:app:unspecified > com.facebook.react:react-native:0.11.0 > com.facebook.fresco:fresco:0.6.1 > com.facebook.fresco:imagepipeline:0.6.1
* 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: 11.247 secs
Could not install the app on the device, see the error above.
Where did I go wrong?
Android Support Repository was missing installed, again followed all the steps here: https://facebook.github.io/react-native/docs/android-setup.html
https://github.com/facebook/react-native/issues/2772#issuecomment-140843907
In case, like me, nothing else you've read has worked, this worked for me:
Check in the latest snapshot of changes to your source control
Remove the project directory from your system
Check out your code from source control
npm cache clean && npm install
watchman watch-del-all
react-native start -- --reset-cache
react-native run-android
:mind-blown:
Doesn't look like you've updated your libs on your machine to the newest version. Download the new versions of the support library/appcompat and then try again
It looks like you don't have android sdk installed and/or the path to it is not set up properly. There are detailed instructions about how to do this in the android setup docs of react native, follow the instructions for Install and configure SDK.
For those encountering this problem when they attempt to simply use the Android SDK Manager (tools/android), I had to run the SDK manager as root (e.g. sudo ./tools/android) to get around this error.
Unfortunately, running an X11-forwarded program as root can sometimes bring about its own issues. If you encounter problems trying to run the SDK manager as root, see this answer here. Specifically, I was able to run the SDK manager as my normal user, but attempting to run as root always failed.
It looks like you don't have android sdk installed and/or the path to it is not set up properly. There are detailed instructions about how to do this in the android setup docs of react native, follow the instructions for Install and configure SDK.