Ionic Run Faild - android

I can run my ionic project on android device perfectly until now but now this error is happens. I did not change anything in project structure.
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 org.xwalk:xwalk_core_library_beta:13+.
Searched in the following locations:
https://repo1.maven.org/maven2/org/xwalk/xwalk_core_library_beta/maven-metadata.xml
https://repo1.maven.org/maven2/org/xwalk/xwalk_core_library_beta/
https://download.01.org/crosswalk/releases/crosswalk/android/maven2/org/xwalk/xwalk_core_library_beta/maven-metadata.xml
file:/Applications/android-sdk/extras/android/m2repository/org/xwalk/xwalk_core_library_beta/maven-metadata.xml
file:/Applications/android-sdk/extras/android/m2repository/org/xwalk/xwalk_core_library_beta/
file:/Applications/android-sdk/extras/google/m2repository/org/xwalk/xwalk_core_library_beta/maven-metadata.xml
file:/Applications/android-sdk/extras/google/m2repository/org/xwalk/xwalk_core_library_beta/
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: 20.525 secs
/Users/myuser/Projects/appname/platforms/android/cordova/node_modules/q/q.js:126
throw e;
^
Error code 1 for command: /Users/myuser/Projects/appname/platforms/android/gradlew with args: cdvBuildDebug,-b,/Users/myuser/Projects/appname/platforms/android/build.gradle,-PcdvBuildArch=x86,-Dorg.gradle.daemon=true
I removed android platform and all node_modules and added them again but still i see this error.
i can serve my app and run on IOS simulator perfectly.

I had the same problem!
I solved it with the following steps:
Remove browser with ionic browser revert android
Install crosswalk again ionic browser add crosswalk
Deploy aplication ionic run android

I had same problem, on run time I used VPN in ionic build android and Ionic run android command. this will help to reach the website to download components.
Also about the maven
I run CMD command with "Run as Administrator" it started to download maven and after that it works fine for me.
Before this I used to upgrade JDK and JRE but has not change in result.
I have upgraded Windows 7 to Windows 10 directly and some times applications needs to start by using "Run As administrator"

I have found the solution for the problem using the google play service and Google Repository in android SDK
Please install the following dependency using android SDK manager Google Play services and Google Repository
Once the installation is completed then you create your project and run.
Now it should work fine

Related

Could not find any version that matches com.google.android.gms:play-services-gcm:12+ (

I'm trying to compile on ionic 3.20 with cordova 6.5.0 on Android.
I'm executing cordova run android but everytime I'm getting:
Error: ~/Develop/blastbot-ionic/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 ':_debugApkCopy'.
> Could not find any version that matches com.google.android.gms:play-services-gcm:12+.
Versions that do not match:
11.0.4
11.0.2
11.0.1
11.0.0
10.2.6
+ 18 more
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.
I have all this installed:
SDK Manager
I've already tried executing cordova platform rm android & cordova platform rm android#6.2 or cordova platform rm android. Both ending in the same result. Downloaded a million different SDK's versions.
I tried cordova platform add android#5 and afterwards cordova run android and it worked like a charm.
UPDATE
The line abov "solved" the issue partially, but my targeted API level was 23 instead of 25. The issue, after almost month and a half of trying different SDK tools/build-tools/Google repo combinations I found the solution.
Navigate to platforms/android/project.properties and look for a line like
cordova.system.library.2=com.google.android.gms:play-services-gcm:12+
Notice that 12+ at the end. Simply change it to 11+, that will do the job. Hope nobody goes through this like I did.

react-native-vector-icons causing issues with android build

I am having an extremely difficult time trying to get react-native run-android to work on my mac so that my react-native android project runs in an emulator. The command runs fine on my windows machine.
This is the error I'm getting:
Configure project :react-native-vector-icons The CompileOptions.bootClasspath property has been deprecated and is
scheduled to be removed in Gradle 5.0. Please use the
CompileOptions.bootstrapClasspath property instead.
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-vector-icons'.
Failed to notify project evaluation listener.
com.android.build.gradle.tasks.factory.AndroidJavaCompile.setDependencyCacheDir(Ljava/io/File;)V
In my Android Studio, I am using the Virtual Device Pixel API 26, API = 26, Target = Android 8.0 (Google APIs).
Here are the SDK Platforms I've selected:
For the SDK Tools, I selected 23.0.1,26.0.1,26.0.2,27.0.1.
How do I get react-native run-android to make the app show in my emulator?
Try commenting out all references to react-native-vector-icons and see if your project runs without
Try getting a newer version of react-native-vector-icons
Try running react-native run-android --info --scan and if you can, approve and then paste the approved scan link in an update to your question.

error occurred configuring project react-native-photo-view

I have just started with ReactNative and created a project using this tutorial. The project got built and a android application got installed on my phone.
Then I used #shoutem/ui library for UI components. According to the documentation, I tried
npm install #shoutem/ui --save
react-native link
and then run the project using
react-native run-android
But then I got this error
PS D:\SK\Study\ReactNative\DemoRN> react-native run-android
Scanning folders for symlinks in D:\SK\Study\ReactNative\DemoRN\node_modules (38ms)
JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
File C:\Users\sukumar\.android\repositories.cfg could not be loaded.
Failed to download any source lists!
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
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-photo-view'.
> Failed to find Build Tools revision 25.0.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: 11.028 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
And then I unlinked the #shoutem/ui
react-native unlink #shoutem/ui
and tried to run the project, but still, I am facing the same issue?
Please ignore if it is too basic to ask, But I am not able to understand what is the issue?
Update
I am not using Android Studio, So I downloaded the build-tools 25.0.0 and placed in sdk/build-tools folder. But now I am facing
> A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23
This seems to be an issue with the available SDK Tools in your installation of Android Studio:
> Failed to find Build Tools revision 25.0.0
Installing these should resolve the issue. To install this, start up Android studio, go to the SDK Manager and select the SDK Tools tab, check the Show Package Details option in the bottom right corner and then check the 25.0.0 SDK Tools and click Apply to download and install them.
Here's a screenshot of the SDK Tools I use for my local environment for reference:
Furthermore, I'd just like to elaborate on the react-native (un)link command. This is used to link native dependencies into your React Native project. Unlinking it is not the same as uninstalling it, you should still be able to use all non-native components of the Shoutem UI Toolkit after unlinking the package.
I am not using Android Studio, So I downloaded the build-tools 25.0.0 and placed in SDK/build-tools folder. This solved the build tools issue but then there was a new issue
A problem occurred configuring project ':react-native-photo-view'. > Failed to find Platform SDK with path: platforms;android-23
The network I was using has configured some firewalls rules that were not allowing the required dependencies get downloaded. When you run react-native run-android it downloads all the dependencies automatically to create the build.
So In my case, I changed my network settings and this worked.

Why can't I run my Cordova Project in Android?

I am trying to run my Cordova Project in a Android platform on a Mac.
I downloaded Android Studio.
However, whenever I try to run the following command line in terminal
cordova run android
it ends in the following error:
BUILD FAILED
Total time: 1.391 secs
Error: /Users/karel/Cordova Projects/demo/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'.
> You have not accepted the license agreements of the following SDK components:
[Android SDK Platform 25].
Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager.
Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Am I missing something?
It works for
cordova run ios
cordova run osx
cordova run browser
How can I accept these terms the message is talking about? I recall accepting to certain terms, at least, when downloading Android Studio.
I am wondering whether I have to install Android SDK separately from Android Studio or something. (I have no experience with Android).
Thanks for your time. Your help would mean a lot.

Cannot make react-native-maps to work on android

I'm trying to create a simple "weather" app using react-native on Android.
I have followed the installation steps but I get following errors when I run 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-maps'.
Could not resolve all dependencies for configuration ':react-native-maps:_debugCompile'.
Could not find com.google.android.gms:play-services-base:8.3.0.
Searched in the following locations:
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
https:// jcenter.bintray.com/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.pom
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-base/8.3.0/play-services-base-8.3.0.jar
Required by:
weather:react-native-maps:unspecified
Could not find com.google.android.gms:play-services-maps:8.3.0.
Searched in the following locations:
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
file:/home/mihir/.m2/repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
https:// jcenter.bintray.com/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.pom
file:/home/mihir/android-sdk-linux/extras/android/m2repository/com/google/android/gms/play-services-maps/8.3.0/play-services-maps-8.3.0.jar
Required by:
weather:react-native-maps: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: 20.584 secs
Could not install the app on the device, rea
You need to install Google Play Services to make react-native-maps work on Android.
Go in a terminal and run android. This should open the SDK manager.
If the command android is not found, you need to install the SDK tools from here
Install Google Play Services and Google Repository.
Rerun react-native run-androidand it should work if you use a device.
If you use an emulator, check this.

Categories

Resources