I have a fairly involved React-Native project in iOS and want to port it over to Android and test it's transferability. I have done the standard install instructions of:
'Install the latest JDK
Install the Android SDK:
On Mac: brew install android-sdk
export ANDROID_HOME=/usr/local/opt/android-sdk
Open the Android SDK Manager (on Mac start a new shell and run android); in the window that appears make sure you check:
Android SDK Build-tools version 23.0.1
Android 6.0 (API 23)
Android Support Repository
Click "Install Packages"'
But I still do not see the Andriod directories in my existing app. Is there a way to get Android dependencies without doing 'react-native init AwesomeProj'?
Adding Android to an existing React Native project
If you already have a (iOS-only) React Native project and want to add Android support, you need to execute the following commands in your existing project directory:
Update the react-native dependency in your package.json file to the latest version
$ npm install
$ react-native android
Related
I try to uninstal cordova then instal again but still not working
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd platform add android exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
It looks like you need to install your android SDK/build tools.
You can do it manually or using your android studio installation if exists.
To do it with Android Studio you can:
Go to settings->Appearance and Behavior->Android SDK
Go to the SDK Platforms tab and select the latest Android SDK
package.
Go to the SDK Toos tab and select the following checkboxes:
Android SDK Build-Tools
Android SDK Platform-Tools
Android SDK Tools
NDK
Android Support Repository
Google Repository
Apply and accept
To do it without using Android Studio there's an answered question here: How do I download the Android SDK without downloading Android Studio?
I am facing below error while trying to compile android app using emulator in appcelerator studio.
Error:
Unable to locate an Android SDK.
If you have already downloaded and installed the Android SDK, you can tell Titanium where the Android SDK is located by running titanium config android.sdkPath /path/to/android-sdk, otherwise you can install it by running 'titanium setup android' or manually downloading from http://appcelerator.com/android-sdk.
I have provided sdk path as /Users/Username/Library/android-sdk-macosx in appcelerator studio.
Using titanium config android.sdkPath /path/to/android-sdk in terminal error titanium: command not found
I have installed Android studio on same Mac and I have provided same path in appcelerator studio
The correct command is
appc ti config android.sdkPath /path/to/android-sdk
Or Else change manually using Appcelerator Studio:-
Click on Axway Appcelerator Studio-->Preferences-->Studio-->Platforms-->Android
and then select android-sdk folder. You are done.
I am having a really annoying issue when I try to run my cordova project on Android.
When I run the command
$ cordova platform add android
it fails with following error:
Error: Failed to run "android". Make sure you have the latest Android SDK installed, and that the "android" command (inside the tools/ folder) is added to your PATH.
However, I do have the android command in my PATH, and I do have an Android SDK installed:
$ echo $PATH
/home/<user>/code/android-studio/gradle/gradle-3.2/bin:/home/<user>/Android/Sdk/tools:/home/<user>/Android/Sdk/platform-tools:<...>
I can even run the android command in the shell, and list the installed SDKs:
$ android list target
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Running /home/arthur/Android/Sdk/tools/bin/avdmanager list target
Available Android targets:
----------
id: 1 or "android-26"
Name: Android API 26
Type: Platform
API level: 26
Revision: 2
My cordova version is as follows:
$ cordova --version
4.0.0
It has to be this version otherwise this project won't build.
What am I missing here? What do I do to cordova to recognize that the android command is actually available?
Thanks!
Which cordova-android version do you have?. Try to run this command
cordova platforms android
Depends which version you have, you need to download an android sdk. For example, cordova-android version 6.2.6 supports Android SDK Tools v26. See this link. I suspect that you have an older version of cordova-android, you'll need to install a minor sdk.
After install plugin and try create simple aplication (.apk file) after click on Release get below error.
Build cmd: Command failed with exit code 1
Adding it as an answer as it is descriptive.
Open your project folder in cmd and run cordova plugin list. You should get list of plugins installed in your project with version something like:
cordova-plugin-whitelist 1.2.0 "Whitelist"
pushwoosh-cordova-plugin 5.0.3 "Pushwoosh"
To check android version run android in cmd. It should open Andoid SDK Manager, if not then check the PATH in system variable. If it is fine then update these two if there is any update.
Android SDK Tools and Android SDK Platform-tools under
Tools
Android Support Repository, Google Play Services, Google Repository under Extras
How do I recover from this error?
[Error: The command android failed. Make sure you have the latest Android SDK
installed, and the android command (inside the tools/ folder) added to your path. Output: ]
You just need to install the Latest version of Android i.e 4.3/4.4
Go to SDK Manager and install the latest SDK Platform.
And try run the command again.
cordova platform add android