Closed rchovan closed 1 year ago
Can you try using cordova-android 11?
cordova platform rm android
cordova platform add android@latest
If that doesn’t work, can you provide a sample app where the issue can be reproduced?
Hi, so far I can't use cordova-android 11 because of project dependencies.
android-targetSdkVersion should be greater than or equal to 32.
Starting a Gradle Daemon (subsequent builds will be faster)
FAILURE: Build failed with an exception.
* Where:
Build file 'D:\Projects\master\platforms\android\app\build.gradle' line: 20
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
> Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
Your current JDK is located in C:\Program Files\Java\jdk1.8.0_301\jre
You can try some of the following options:
- changing the IDE settings.
- changing the JAVA_HOME environment variable.
- changing `org.gradle.java.home` in `gradle.properties`.
For the first problem, make sure you don't have a <preference name="android-targetSdkVersion" value="xx" />
entry in your config.xml
For the second problem, you have to use java 11 instead of java 8
closing since no sample app was provided and no feedback was received since last answers
In platforms/android/android.json this shows up after the first build
"undefined": {
"parents": {
"AndroidManifest.xml": []
}
},
@steveetm thanks, removing this "undefined" property from android.json fixed build process.
Same problem for me, do i need to remove the entire code block ?
"undefined": {
"parents": {
"AndroidManifest.xml": [
{
"xml": "
sudo npm uninstall -g cordova
sudo npm install -g cordova@11.0.0
cordova --version
sudo npm cache clean -f
sudo npm install -g n
sudo n 18.12.0
cordova platform rm ios
cordova platform add ios@6.0.0
Bug Report
Problem
Android build is working first time after adding android platform, but on second time it show this error "The "path" argument must be of type string. Received undefined". I can only remove and again add platform to make it work.
What is expected to happen?
build application without error
What does actually happen?
build end with error:
Information
System Windows 10 64bit
Command or Code
cordova prepare android
Environment, Platform, Device
Windos 10, Android 10.1.2
Version information
cordova platforms
cordova --version
cordova plugins
Operating System: Windows 10 64bit, IDE: Vscode / IntelijIDEA
node --version
v14.18.3
Checklist