Cannot get ionic to build android apk - android

I have problems getting ionic to build a proper android apk.
The ionic code is alright because I can build a proper apk on another PC.
When I run ionic build android, the android apk was successfully generated but when I install the apk, installation is not successful.
When I run ionic build android the second time, the following error was encountered;
FAILURE: Build failed with an exception.
What went wrong: Unable to start the daemon process. This problem might be caused by incorrect configuration of the daemon. For example,
an unrecognized jvm option is used. Please refer to the user guide
chapter on the daemon at
http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html Please read
the following process output to find out more:
----------------------- Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create
the Java Virtual Machine. Error: A fatal exception has occurred.
Program will exit.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
C:\Users\own\Dropbox\Workplace\xampp568\htdocs\ionicApp\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^ Error code 1 for command: cmd with args: /s /c "C:\Users\own\Dropbox\Workplace\xampp568\htdocs\ionicApp\platforms\android\gradlew
cdvBuildDebug -b C:\Users\own\Dropbox\Wor
kplace\xampp568\htdocs\stkview\stkApp\platforms\android\build.gradle
-Dorg.gradle.daemon=true"

I was also getting the same error, then I deleted .glade file and reopened the android studio. It's working now.

I encountered similar error before. What I did was delete platforms\android\.gradle and run ionic build android again.

Related

React Native android adbExe does not exist

While i run react native android app in visual code i get this error. I need help to resolve this issue. Thanks.
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration of task ':app:installDebug'.
File 'C:\Users\Supun\AppData\Local\Android\Sdk\platform-tools\adb.exe' specified for property 'adbExe' does not exist.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 34s
26 actionable tasks: 26 executed
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/getting-started.html
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe ENOENT
at _errnoException (util.js:1024:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
I know this is an old topic, but I'll post it here in case if anyone is having the same issue.
For me, this usually happens when WSL is being used, while Android SDK is installed under Windows (there you have adb.exe instead of adb).
Making another copy of adb.exe binary as adb resolved the issue for me:
copy adb.exe adb

Dependency error in React Native for Android

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

Ionic app build issue

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.

Meteor while running on android device gives this error

Suddenly out of no where I am seeing this issue with starting app on device.
I have been struggling for long with no luck while trying to start meteor on android device.
I use meteor run android-device to run on device btw!
=> Errors executing Cordova commands:
While running Cordova app for platform Android with options --device:
Error: Command failed:
C:\Users\ally\Documents\GitHub\Portal-Meteor\portalMeteor\.meteor\local\cordova-build\platforms\android\cordova\run
--device --device
FAILURE: Build failed with an exception.
* What went wrong:
Unable to start the daemon process.
This problem might be caused by incorrect configuration of the daemon.
For example, an unrecognized jvm option is used.
Please refer to the user guide chapter on the daemon at
http://gradle.org/docs/2.2.1/userguide/gradle_daemon.html
Please read the following process output to find out more:
-----------------------
Error occurred during initialization of VM
Could not reserve enough space for object heap
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Error code 1 for command: cmd with args:
/s,/c,"C:\Users\ally\Documents\GitHub\Portal-Meteor\portalMeteor\.meteor\local\cordova-build\platforms\android\gradle
w
cdvBuildDebug -b
C:\Users\ally\Documents\GitHub\Portal-Meteor\portalMeteor\.meteor\local\cordova-build\platforms\android\build.gradle
-PcdvBuildArch=arm -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true" undefined
at ChildProcess.exitCallback (C:\tools\utils\processes.js:151:23)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
C:\Users\ally\AppData\Local\.meteor\packages\meteor-tool\1.3.2_4\mt-os.windows.x86_32\isopackets\cordova-support\npm\nod
e_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:116
throw error;
^
ExitWithCode:1
removing and re-installing android studio worked :)

geetting error while running ionic crosswalk integration

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.

Categories

Resources