Cordova Build Failed: Error starting modern compiler - android

HI i am trying to generate cordova 3.5.1.jar .but getting the below error in my command prompt window.Can any one help to sp
BUILD FAILED
E:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\too
ls\ant\build.xml:720: The following error occurred while executing
this line:
E:\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\tools\ant\build.xml:734: Error starting modern compiler
Total time: 5 seconds

You probably have messed up with your Java installation by accident.
If you want to troubleshoot Cordova build process you could run command below:
cd <path/to/project>
ant -v -f ./platforms/android/build.xml debug
assuming that you are using cordova tool for the running build.

Related

React Native: fail while installing the "app". Error at executing gradlew.bat

​Well, I am trying to install all components to run React Native apps on my computer, but I have been working on this for four days and I always got the same error message:
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
​I reinstalled the components three times, but only some things changed, like the time that jumped from 30 minutes to 3 hours, and the quantity of text that shows on my screen.
​I tried a lot of solutions I found on the internet, like uninstall the global react-native-cli and use .\gradlew clean however it did not work because I got a message saying that "." is not recognized like a command. I really do not know how to correct it...
Bellow, my computer configurations:
System: Windows 7 professional SP1
Processor: Intel Atom CPU D525 #1.80Ghz 1.79GHz
RAM memory: 2,00GB
Type of system: 32-bit operating system
The React Native component versions I installed:
Chocolatey: v0.10.15
Node.js: v12.13.0
Npm: 6.12.0
Yarn: 1.22.5
Python: 2.7.18
JDK 8: 1.8.0_271
Android Studio: 3.6.3
Observations:
I also have Python 3.8 installed
I also tried the command line tools only before the Android Studio IDE
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Unknown failure: Exception occurred while executing:
android.os.ParcelableException: java.io.IOException: Requested internal only, but not enough space
at android.util.ExceptionUtils.wrap(ExceptionUtils.java:34)
at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:413)
at com.android.server.pm.PackageManagerShellCommand.doCreateSession(PackageManagerShellCommand.java:2418)
at com.android.server.pm.PackageManagerShellCommand.runInstall(PackageManagerShellCommand.java:907)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:158)
at android.os.ShellCommand.exec(ShellCommand.java:103)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:22015)
at android.os.Binder.shellCommand(Binder.java:634)
at android.os.Binder.onTransact(Binder.java:532)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2809)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:4070)
at android.os.Binder.execTransact(Binder.java:731)
Caused by: java.io.IOException: Requested internal only, but not enough space
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:232)
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:148)
at com.android.internal.content.PackageHelper.resolveInstallVolume(PackageHelper.java:163)
at com.android.server.pm.PackageInstallerService.createSessionInternal(PackageInstallerService.java:510)
at com.android.server.pm.PackageInstallerService.createSession(PackageInstallerService.java:411)
... 10 more
* 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 1h 47m 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
Note: C:\Users\myusername\Desktop\appproject1\android\app\src\debug\java\com\appproject1\ReactNativeFlipper.java uses or overrides a deprecated API.
C:\Users\myusername\Desktop\appproject1>
​ I apologize for not being able to give you more information. I ask you to help me, please.
Edit:
I would like to give some tips about problems I got when trying to use react-native:
Low space on the smartphone. Please try to install something in the store, if you cannot do it, you need to free some space.
Some problems could be solved only by trying to run the project by Android Studio, please try it too.
Cache may be your problem. Try it inside the project folder:
cd android
gradlew clean
after it, run the project again returning to the project folder using cd ..:
cd ..
react-native run-android
Issue:
> Caused by: java.io.IOException: Requested internal only, but not enough space
solution -1-
replace
android:installLocation="internalOnly"
with
android:installLocation="preferExternal"
solution -2-
make some space on the device / emulator

Build succeeded but a gradle error gets thrown

I've setup my Cordova tools on Visual Studio 2015 update 3.
I am currently using Cordova version 7.1.0 and created a blank Cordova project, but when building this error gets print on the build output:
Command finished with error code 0: cmd /s /c "path\to\project\platforms\android\gradlew.bat cdvBuildDebug -b path\to\project\platforms\android\build.gradle -Dorg.gradle.daemon=true -Dorg.gradle.jvmargs=-Xmx2048m -Pandroid.useDeprecatedNdk=true"
Regardless the error, the application seems to be working fine and it loads correctly on the Android emulator.
Any idea of what the problem could be?
Thanks in advance :)
Actually, error code 0 here means that there wasn't any error at all, so you can safely ignore that message.
You should worry only when you don't see error code 0, that's when you'll get errors but usually they have a detailed description included.

Compiling a project through command line

I have a android project which I build through android studio and it worked fine. Then I took a new system and I am trying to build it through command line with this command :
./gradlew assembleDebug
which is giving me error this:
could not find com.android.support:support-v4:22.1.1
How to resolve this.

nativescript sample projects fail with error Command ant failed with exit code 1

I went through the setup steps - on mac - but the sample nativescript projects all fail with the same error.
"Command ant failed with exit code 1"
Here is the log trace:
https://gist.github.com/getsetbro/c0225e8fc493d57b3f64
Other info
Android Studio on this mac run projects fine in emulators and connected devices
The same projects run in ios emulator without errors.
I installed JDK 8, never had version 7 on this system.
I see the following error in the logs.
Cannot run program "/Users/sb/Documents/Dev/nativescript/test_nativescript/platforms/android/${aapt}"
I might be wrong but it seems aapt tool is missing from your $PATH environment variable. If this is the case, try adding <ANDROID_SDK_ROOT>/tools to $PATH

Appium - reset.sh fails with error on "buildAndroidBootstrap" task on Mac

There could be a problem with my configuration, but I cannot figure out what's wrong. I am trying to get appium set up on a Mac for automated testing.
I am running this command:
./reset.sh --android --verbose
I always fail on this step:
* Building Android bootstrap
Running "buildAndroidBootstrap" task
Fatal error: Error finding ant binary, is it on your path?
---- FAILURE: reset.sh exited with status 1 ----
My path is as follows:
# Android and appium config
export ANDROID_HOME=/usr/local/opt/android-sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
What am I doing wrong? Is my path missing something crucial? Googling to try and find out what the ant library is hasn't yielded me much results - what is it? Any help appreciated.
Turns out ant is an apache tool, without which reset.sh will fail for Android. Installing ant with brew fixed the problem.

Categories

Resources