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.
Related
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.
I'm a complete beginner at creating mobile apps. I created an Ionic mobile app for Android using Windows and Visual Studio 2017. It works when I use the ionic serve command and try the app in the browser.
But when I try to import the project into Android Studio 2.3.3, I get an error message, that it can't build my app:
"Gradle sync failed: Failed to find target with hash string 'android-26' in: ...\AppData\Local\Android\Sdk
Gradle sync completed.
Gradle build finished with 1 error(s)."
I also get another error message after importing the project into Android Studio, when I try to run the "ionic cordova run android" command in cmd: "An error occured while running cordova run android. FAILURE: Build failed with an exception. Where: ...\cordova.gradle line 64
What went wrong:
A problem occured evaluating root project 'android'. No installed build tools found. Install the Android build tools version 19.1.0 or higher."
I imported the files into Android Studio choosing Import project (Eclipse,...). I chose this folder when importing:
node_modules\cordova-android\spec\fixtures\android_project. I'm not sure this is the right folder to choose.
I can see the simulated android phone , I can click on everything, but my app doesn't show up on it.
I checked the Android build tools, 25.0.3 and 26.0.2 are installed.
Thank you for the help in advance! I'm really stuck :S
You are choosing Wrong Folder.
To open your ionic generated app. You need to open the following folder in the path:
Your_ionic_project/platforms/android
Check whether you have set your system PATH variable pointing to android platform tools.
Something like :
C:\Users\Lokkeshwaran J\AppData\Local\Android\Sdk\platform-tools
I'm trying to use Cordova to build a hello world app and after adding ANDROID_HOME variable (You'd be shocked how long that took to figure out) all I keep seeing when building is this:
BUILD FAILED
Total time: 1 mins 6.679 secs Error:
/Users/vladdy/Desktop/laboratory/cordovaBackgroundApp/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'.
Failed to find target with hash string 'android-25' in: /Users/vladdy/Library/Android/sdk
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Ok fair enough so let's go install it:
Waiting patiently for the install, and same error running cordova build.
I wonder what else we need to install? But look, it seems that Android Studio still has Nougat and 25 available:
Why is Android Studio not installing anything?
I can see why PhoneGap Build is so popular...
Edit:
cordova requirements is now broken reporting the following:
My ~/.bash_profile:
export ANDROID_HOME=/Users/vladdy/Library/Android/sdk/
Requirements?
If you don't need Android Studio, I recommend not downloading it, instead, as #Tom-Esendam also suggest, go for the command-line tool.
Android Studio and Command Line Tool
Direct download link of Command Line Tool for OSX (2017-03-21)
Proxy?
And if your behind a proxy server, don't forget to add it to the settings in the SDK Manager Settings.
What does the different programs and commands?
cordova build doesn't download any SDK's.
cordova prepare appends the necessary SDK files to the cordova build folders.
After download of Command Line Tool:
After unzipping it, set ANDROID_HOME to it's root, so you have:
build-tools
extras
platforms
platform-tools
system-images
tools
catalogs under the root.
Adding SDK's:
Then install SDK's with ./tools/android.
Android SDK Manager downloads the SDK's, so you check what you need and hit OK to download it.
Preparing the build
Make sure all proxy settings are set if your behind a proxy.
Before running cordova build run cordova prepare. This shouldn't be necessary, but least I need to run that even thou cordova build should include that.
I don't know about the mac version. But on windows you have a standalone sdk manager. If there is one on mac try that?
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