I want to compile an open source android project (Netguard) using gradel (gradlew clean build
) But I encountered this Error:
A problem occurred
If you don't use the NDK, unset the environment variable ANDROID_NDK_HOME
.
Solved it by adding google()
dependency into both repositories in build.gradle
(Project: ProjectName). then sync your project
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
Open Android Studio, Go to Tools then Android and then SDK, uncheck NDK If you do not need this, and restart android studio.
Without downloading, copying, or symlinking anything, I was able to "fix" the error by simply creating an empty directory where the older version of the Android Gradle plugin expects the removed mips toolchain:
mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/linux-x86_64
Obviously, $ANDROID_HOME
points to the root of the Android SDK installation here. If you are using MacOS, replace linux-x86_64
with darwin-x86_64
in the command above. On Windows use windows-x86_64
.
I fixed this Error by uninstalling the NDK in the SDK-Tools. So, if you don't need the NDK, uninstall it.
Facing same issue.
I got success following ways.
Open your buldle.gradle file and upgrade the versions for following both classpath
classpath 'com.android.tools.build:gradle:3.2.1' classpath 'com.google.gms:google-services:4.2.0'
Then Sync and after get one dilaog for update Gradle version as well then click that link and wait for download all required updates(Hope internet available). After taking long time you got Success.