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.
Related
Hi I'm following the guidelines of https://rnfirebase.io/docs/v3.1.x/installation/initial-setup to install firebase for React Native. I'm using an Android Emulator.
After everything is done I cannot start the application. That's what happens when starting the app via 'react-native run-android':
Parsing json file: C:\Users\Studium\WebstormProjects\app-programming\android\app\google-services.json
:app:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
Failed to create folder: C:\Users\Studium\WebstormProjects\app-programming\android\app\build\generated\res\google-services\debug
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: 25.864 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
Does someone know what I did wrong?
In firebase console, you can get google-services.json file and place it in android/app directory and get googleServices-info.plist file and place it in /ios directory
if you want to use analytics only use firebase analytics it works for me.
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.
I have been following this link to get started with react native
https://facebook.github.io/react-native/docs/getting-started.html
When i try to run this command react-native run-android in my project folder I get the following error
`FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
failed to find target with hash string 'android-23' in: /home/knolly/Android/Sdk/platforms
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.225 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`
ANDROID_HOME is set in ~/.bashrc and platforms folder contain android-23.
What am I doing wrong here ?
The problem seems to be that you don't have installed the correct SDK required by RN.
If you open the file android/app/build.gradle you'll find the following line:
compileSdkVersion 23
buildToolsVersion "23.0.1"
Make sure that, on Android Studio, you have the correct SDK version installed:
And the correct SDK tools:
please try to open your "android" folder under react native project with "Android Studio".
It'll help you install all of missing build tool.
I'm manually installing an Android-Gradle build server which means that I'm not using Android Studio SDK but instead using the android update sdk command to install the required tools.
I was able to install most of the packages which are required for the build to finish successfully but there are some tools which I'm unable to find:
com.android.support.constraint:constraint-layout:1.0.0-alpha(1-4)
com.android.support.constraint:constraint-layout-solver:1.0.0-alpha(1-4)
Following #CommonsWare comment, here's the output of the build (which shows that the tools are being looked for at the repositories automatically but not found:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Company'.
> Could not resolve all dependencies for configuration ':Company:_productionDebugCompile'.
> Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha4.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
Required by:
Company-Android_fork:Company: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: 15.163 secs
Any idea how they can be installed manually (not through Android Studio)?
Thanks in advance,
Now you can install it through command line:
your_sdk_location/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
It is not possible without Android Studio 2.2 Beta yet, but if you have it somewhere, then you just need to copy the m2repository from your sdk/extras to your project sdk/extras folder.
So if you have your project built in an Android Studio:
check the project's sdk location (File/Project Structure : SDK location).
go to your_sdk_location/extras folder and copy m2repository
paste the folder to your existing project's sdk/extras folder.
rebuild your project.
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