I am new to ionic. I have developed sample application ionic.
When I try to execute below command it gives gradle error.
$ ionic build android
Below is the build error:
Error: /home/myapp/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred starting process 'Gradle build daemon'
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Gradle version is 3.3
Android SDK and Android Studio located in /usr/local/ folder
You will either have to move it to your home directory (that involves reinstall).
Or run ionic build commands with sudo
sudo ionic build android
You could technically change permissions of the specific sdk and studio folders but it is not advisable especially in /usr directory.
Related
I just finished setting flutter up in VS Code, I created an android emulator and it runs fine, but when i try to launch the demo app of flutter i get this error:
Launching lib\main.dart on AOSP on IA Emulator in debug mode...
Parameter format not correct -
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation 'C:\Program Files\Java\jre1.8.0_291' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
What's the problem?
Install Android Studio, it is a must if you are new, you can always use VSCODE for development but Android studio needs to be there.
Best way is uninstall vscode, install android studio, install flutter and dart plugin in android studio, then install vscode, it will work.
Also try running
flutter doctor
What does it say?
I am writing a React Native App for Android. I initialized the project with the react-native-cli. When I try to run it on Android, I get the following error:
$ react-native run-android
Scanning folders for symlinks in /path/to/myreactnativeproject/node_modules (6ms)
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 'myreactnativeproject'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not find com.android.tools.build:gradle:3.0.1.
Searched in the following locations:
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.0.1/gradle-3.0.1.jar
Required by:
:myreactnativeproject: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: 11.226 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
I am using Ubuntu 16.04 and I installed Android Studio 3.0.1. What is the reason for the error?
Edit: When I run it with stacktrace, info and debug, I get the following output:
I can't post the output here, because it is to long: pastebin
I fixed it by adding this to .bashrc:
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64"
export PATH=$JAVA_HOME/bin:$PATH
I create the simple React Native Project.
Step 1.
C:>react-native init AwesomeProject
Step 2.
C:>cd AwesomeProject
Step 3.
C:>react-native run-android
After that I faced the following error.
C:\Users\Smith\AwesomeProject>react-native run-android
Scanning 575 folders for symlinks in C:\Users\Smith\AwesomeProject\node_modul
es (13ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat install
Debug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> The SDK directory 'C:\Users\Smith\AwesomeProject\android\C:UsersSmithApp
DataLocalAndroidsdk' does not exist.
* 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: 4.774 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
Thanks!!
Android sdk path in your enviroment is not correct.
Having huge issues trying to build to android with Ionic. I tried initially the normal ionic build android, it failed with
[Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.]
I did some hunting around stack overflow and ionic forums, and installed Java and Android Studio as a 'solution', it began to install lots of .jar files, and this happened:
Download https://repo1.maven.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
Download https://repo1.maven.org/maven2/commons-codec/commons-codec/1.4/commons-codec-1.4.jar
Download https://repo1.maven.org/maven2/com/android/tools/external/lombok/lombok-ast/0.2.3/lombok-ast-0.2.3.jar
Download https://repo1.maven.org/maven2/org/abego/treelayout/org.abego.treelayout.core/1.0.1/org.abego.treelayout.core-1.0.1.jar
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> failed to find target with hash string 'android-23' in: /Users/.../Library/Android/sdk
* 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: 51.558 secs
Error: /users/nick/documents/.../.../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-23' in: /Users/.../Library/Android/sdk
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Please install Android target: "android-23".
Hint: Open the SDK manager by running: /Users/.../Library/Android/sdk/tools/android
You will require:
1. "SDK Platform" for android-23
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools" (latest)
Any advice? Maybe I need to un-install Android Studio or something? I'm very bad at this, as you likely can tell. But this is hugely holding back the project I'm working on, so will be amazing if someone could help!
Base from Installing the Android Development Environment
Configure the ANDROID_HOME environment variable based on the location of the Android SDK. Additionally, consider adding ANDROID_HOME/tools, and ANDROID_HOME/platform-tools to your PATH.
For Mac :
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
For windows :
set ANDROID_HOME=C:\<installation location>\android-sdk-windows
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
For linux :
export ANDROID_HOME=/<installation location>/android-sdk-linux
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
i am new to ionic framework, i was unable to get the inspect elements when i debug my application on my android mobile, so i tried installing crosswalk
with the following steps
npm install -g ionic
ionic platform add android
ionic browser add crosswalk
i had followed the steps and even tried uninstalling the application and reverting the crosswalk, but the error remains same. this is the error which i am facing.
* What went wrong:
Execution failed for task ':processArmv7DebugManifest'.
> Manifest merger failed with multiple errors, see logs
* 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: 41.063 secs
G:\GTM\Ionic\ionic programs\recipes\platforms\android\cordova\node_modules\q\q.j
s:126
throw e;
^
Error code 1 for command: cmd with args: /s /c ""G:\GTM\Ionic\ionic programs\rec
ipes\platforms\android\gradlew" cdvBuildDebug -b "G:\GTM\Ionic\ionic programs\re
cipes\platforms\android\build.gradle" -PcdvBuildArch=arm -Dorg.gradle.daemon=tru
e"
ERROR running one or more of the platforms: Error: cmd: Command failed with exit
code 1
You may not have the required environment or OS to run this project
can anyone help me with this error.
thanks in advance.