Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NDK 18 toolchains #504

Closed
bugsmafia opened this issue Sep 21, 2018 · 14 comments
Closed

NDK 18 toolchains #504

bugsmafia opened this issue Sep 21, 2018 · 14 comments
Labels

Comments

@bugsmafia
Copy link

From Android NDK v18 removed support:
mips64el-linux-android-4.9
mipsel-linux-android-4.9

cordova run android: fail
"No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android"

Loading the old archive NDK v17
https://developer.android.com/ndk/downloads/older_releases
and copy in local folder android-sdk > toolchains

@janpio janpio added the support label Sep 21, 2018
@janpio
Copy link
Member

janpio commented Sep 21, 2018

Thanks for creating this issue, seems like instructions how to fix things, right?

When exactly is this needed? I never got in contact with Android NDK when creating a Cordova app.

@bugsmafia
Copy link
Author

bugsmafia commented Sep 21, 2018

Thanks for creating this issue, seems like instructions how to fix things, right?

When exactly is this needed? I never got in contact with Android NDK when creating a Cordova app.

Android studio updated my NDK and I had problems with the Cordova-Android

gradle version for Android studio should now be 3.1 and higher

cordova-android v 7.0.0 - creates "build.gradle" classpath 'com.android.tools.build:gradle:3.0.1'

@bugsmafia
Copy link
Author

https://android.googlesource.com/platform/ndk/+/ndk-release-r18/CHANGELOG.md

This version of the NDK is incompatible with the Android Gradle plugin version 3.0 or older. If you see an error like No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android, update your project file to use plugin version 3.1 or newer. You will also need to upgrade to Android Studio 3.1 or newer.

@ubergeek77
Copy link

Correct me if I'm wrong, but does this mean cordova-android can't currently build for aarch64? I have the toolchain "aarch64-linux-android-4.9" available on my system, however I receive the same error message, stating that "mips64el-linux-android" is not available. However, I don't want to build for a 64-bit MIPS based device. I want to build an app for my phone, which uses an AArch64 processor.

What do I have to do to get a build going for this architecutre? I've tried adding all of these config options to no avail.

dpogue added a commit to dpogue/cordova-android that referenced this issue Sep 26, 2018
@dpogue dpogue mentioned this issue Sep 26, 2018
3 tasks
dpogue added a commit to dpogue/cordova-android that referenced this issue Sep 27, 2018
@ndarilek
Copy link

Is there any workaround for this? As of now, Cordova Android fails to build with the latest stable Android Studio, and appears to have for quite some time. I tried upgrading com.android.tools.build:gradle to 3.1, but now that uses Gradle 4.4, and everywhere I try using Gradle 4.4 (I.e. app/build.gradle, gradle-wrapper.properties) something overrides that and bumps it back to 4.1. Immensely frustrating out-of-the-box experience. If there some sort of sdkmanager incantation I should run, I'd expect to find it on https://cordova.apache.org/docs/en/latest/guide/platforms/android/, but I'm just told to install the latest Android Studio. I'm not actually using Android Studio, just the command line, but Android apps definitely build, so aside from not having an older dependency or not being able to upgrade things myself without Cordova undoing them, I don't know what to try next.

Thanks.

@Meithal
Copy link

Meithal commented Oct 24, 2018

The workaround is to download the older NDK and replace the currently ndk installed in your android Sdk directory with it.

dpogue added a commit to dpogue/cordova-android that referenced this issue Nov 1, 2018
dpogue added a commit to dpogue/cordova-android that referenced this issue Nov 1, 2018
dpogue added a commit to dpogue/cordova-android that referenced this issue Nov 6, 2018
dpogue added a commit to dpogue/cordova-android that referenced this issue Nov 6, 2018
dpogue added a commit to dpogue/cordova-android that referenced this issue Nov 21, 2018
@dpogue
Copy link
Member

dpogue commented Nov 21, 2018

This has been fixed in master and will be released in the next major version of Cordova Android.

@dpogue dpogue closed this as completed Nov 21, 2018
@carlosascari
Copy link

Google led me here when I was looking for a solution for this problem.

Heres my solution in case some one else finds it useful

  1. Changing 3.0.1 to 3.1.0 in the build.gradle file So it looks like: classpath 'com.android.tools.build:gradle:3.1.0'

  2. And the following env variable to force gradle 4.4

export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-4.4-all.zip

It appears that gradle-wrapper.properties is overwritten with 4.1 by the following code:

  • cordova/lib/builders/GradleBuilder.js:251
  • cordova/lib/builders/StudioBuilder.js:227

@ngocdaothanh
Copy link

This has been fixed in master and will be released in the next major version of Cordova Android.

@dpogue Has it been released yet? If no, can you release it very soon?

I'm having the problem mentioned in this issue.

cordova -v on my Mac gives 8.1.2 (cordova-lib@8.1.1).

@ngocdaothanh
Copy link

export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-4.4-all.zip

@carlosascari Thanks a lot! You saved many hours for me.

As of Feb 25, 2019, I use Android Studio 3.3.1 with latest packages to fix the Cordova generated project. Then to be able to run cordova build android from command line, I need to use a newer version:

export CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL=https://services.gradle.org/distributions/gradle-4.10.1-all.zip

@dpogue
Copy link
Member

dpogue commented Feb 25, 2019

This has been released in cordova-android@8.0.0.

@elmbrent
Copy link

I'm on latest cordova and I get the same issue.

@giacomocerquone
Copy link

No I don't, remove platform and add it again with @8.0.0

@julioalberto64
Copy link

Linux
mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/linux-x86_64
MacOS
mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/darwin-x86_64
Windows
mkdir %ANDROID_HOME%\ndk-bundle\toolchains\mips64el-linux-android\prebuilt\windows-x86_64
The ANDROID_HOME environment variable points to the the root of the Android SDK installation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests