freir96
freir96

Reputation: 143

How to configure android studio to build this project?

I have cloned this project https://github.com/asoehlke/ai-piano-accompanist-app, but could not build it on my android studio.

After running it I get:

No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android This version of the NDK may be incompatible with the Android Gradle plugin version 3.0 or older. Please use plugin version 3.1 or newer.

After updating plugin to version 3.4.1 and sync project I get:

ERROR: Could not find com.android.tools.build:gradle-experimental:3.4.1. Searched in the following locations: - https://jcenter.bintray.com/com/android/tools/build/gradle-experimental/3.4.1/gradle-experimental-3.4.1.pom - https://jcenter.bintray.com/com/android/tools/build/gradle-experimental/3.4.1/gradle-experimental-3.4.1.jar - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-experimental/3.4.1/gradle-experimental-3.4.1.pom - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle-experimental/3.4.1/gradle-experimental-3.4.1.jar Required by: project :

Before update

classpath 'com.android.tools.build:gradle-experimental:0.11.0'

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

After update

classpath 'com.android.tools.build:gradle-experimental:3.4.1'

distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip

The answers from Could not find com.android.tools.build:gradle-experimental:3.4.0 in android studio also did not help me.

Upvotes: 1

Views: 455

Answers (1)

Gabriele Mariotti
Gabriele Mariotti

Reputation: 365048

Use the android plugin

classpath 'com.android.tools.build:gradle:3.4.2'

instead of experimental plugin.

Also update the repositories blocks:

buildscript {
    repositories {
        google()
        //...
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.4.2'
    }
}

and:

allprojects {
    repositories {
        google()
        jcenter()
    }
}

In app/build.gradle you have to change the plugin:

apply plugin: 'com.android.application'

instead of

apply plugin: 'com.android.model.application'

Also you have to adapt the model (revome the model keyword)

android {
  defaultConfig {
      minSdkVersion XX
      targetSdkVersion 23
      ...
  }
  buildTypes {...}
  ...
}

dependencies {
   //...
}  

Check the documentation.

Upvotes: 2

Related Questions