and had an error. (see below for excerpts) I am using npm 6.4.1, ionic 4.3.1 and cordova 8.1.2 on a mac with High Sierra. Android Studio has a Project Structure with gradle version 4.6 and android plugin version 3.2.1.
Why does it download …/gradle-4.1-all.zip and then download …/gradle/3.0.1/gradle-3.0.1.pom and related?
Why is it looking for NDK toolchains folder for ABI with prefix: mips64el-linux-android?
…
cordova build android
Android Studio project detected
ANDROID_HOME=/Users/jsmythe/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home
studio
Subproject Path: CordovaLib
Subproject Path: app
Downloading https://services.gradle.org/distributions/gradle-4.1-all.zip
BUILD FAILED in 2m 24s
/Users/jsmythe/ionic/tabsCordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ‘:CordovaLib’.
No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I just found several entries in 4 of the android files that seem to explain why the build is looking for old versions of gradle. Why is the gradle version in Android Studio ignored?. Is this a bug???
I changed 3.0.1 to 3.2.1, 4.1.0 to 4.6.0 and 4.1 to 4.6 and had another error. There is no /Users/jsmythe/Ionic/tabsCordova/gradle/ folder and a directory /Users/jsmythe/Ionic/tabsCordova/platforms/android/gradle/4.1 is created. In addition, /Users/jsmythe/Ionic/tabsCordova/platforms/android/gradle/wrapper/gradle-wrapper.properties is changed back to gradle-4.1-all.zip.
What went wrong:
A problem occurred evaluating project ‘:CordovaLib’.
> Failed to apply plugin [id ‘com.android.library’]
> Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/jsmythe/Ionic/tabsCordova/gradle/wrapper/gradle-wrapper.properties to gradle-4.6-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED in 2s
/Users/jsmythe/ionic/tabsCordova/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred evaluating project ‘:CordovaLib’.
> Failed to apply plugin [id ‘com.android.library’]
> Minimum supported Gradle version is 4.6. Current version is 4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/jsmythe/Ionic/tabsCordova/gradle/wrapper/gradle-wrapper.properties to gradle-4.6-all.zip
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I just found 2 files called GradleBuilder.js and StudioBuilder.js in
tabsCordova/platforms/android/cordova/lib/builders
with
var distributionUrl = process.env[‘CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL’] || ‘https\://services.gradle.org/distributions/gradle-4.1-all.zip’;
and changed 4.1 to 4.6. I was able to build
tabsCordova/platforms/android/app/build/outputs/apk/debug/app-debug.apk