I am using Android Studio 3.0.1 and I have updated the Gradle plugin from 4.1 to 4.4 and also tried to upgrade the android plugin Gradle from 3.0.1 to 3.1.3. The problem is AS cannot update the android plugin and gives me this error.
Error:Could not find com.android.tools.build:gradle:3.1.3.
Searched in the following locations:
file:/F:/android studio/gradle/m2repository/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom
file:/F:/android studio/gradle/m2repository/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.jar
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom
https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.jar
https://maven.google.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom
https://maven.google.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.jar
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.pom
https://jcenter.bintray.com/com/android/tools/build/gradle/3.1.3/gradle-3.1.3.jar
Based on the same questions I've added maven repo in Project level build.gradle in addition to google() used for AS 3.0 and higher but the problem hasn't been solved.
buildscript {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
try alter and verify that in the "gradle-wrapper.properties" file to amend the gradle dist to a much later version for example
distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip
and also update the android support lib version to latest version as well for eg 27.1.1
Make sure you have "Enable embedded Maven repository" checked (in Prefrences / Settings menu)
Related
I'm building apk from an android project exported from Cocos Creator V2.4.3 but getting the below error with Gradle
A problem occurred configuring project ':game'.
> java.lang.NullPointerException (no error message)
I've deleted all android SDK, NDK and re-installed Android Studio, then re-update SDK, NDK, Build Tool.
But the error still occurs.
Some configurations:
Android SDK = 23, 26, 28, 30
SDK Build Tool = 30.0.3
NDK = 19.2.5345600
Gradle version: 4.10.3
Gradle plugin version: 3.2.0
JDK: jdk1.8.0_281
The build.gradle looks like this
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs 'libs'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Anyone has any idea about what should be done to fix this?
I had the same issue, I solved this by specifying 3.6.3 as Android Gradle plugin version and 5.6.4 as Gradle version.
You can do this by clicking File--> project structure--> project then type the versions I mentioned above then click on apply.
wait for the new versions to be downloaded and rebuild your project.
The problem was with setting the NDK Path in Cocos Creator.
I've changed
C:\Users\SomeUserName\AppData\Local\Android\Sdk\ndk
into
C:\Users\SomeUserName\AppData\Local\Android\Sdk\ndk\19.2.5345600
And things worked
I have an older libGdx project that uses version 1.9.1 and Gradle 2.4. I`ve tried upgrade to libGdx 1.9.11 and Gradle 6.5. But I get the following build error:
Gradle sync failed: Could not find org.jetbrains.trove4j:trove4j:20160824.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
- https://oss.sonatype.org/content/repositories/snapshots/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
- https://dl.google.com/dl/android/maven2/org/jetbrains/trove4j/trove4j/20160824/trove4j-20160824.pom
Required by:
project : > com.android.tools.build:gradle:4.1.1 > com.android.tools.build:builder:4.1.1 > com.android.tools:sdk-common:27.1.1
How can I solve it?
Add jcenter() in your root build.gradle file
repositories {
jcenter() // <- Add this
mavenLocal()
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
google()
}
Then sync your project with gradle file. Make sure gradle is not in offline mode and you've good network connection.
Hello I have a problem I upgraded my android studio into android 3.3.2. When I opend my old project it was syncing and at the end it gives me errors like this:
ERROR: The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher.
The following dependencies do not satisfy the required version:
root project 'BreatherApp' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
Affected Modules: app
ERROR: Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.30
Show in Project Structure dialog
Affected Modules: app
build.gradle
buildscript {
ext.kotlin_version = '1.3.11'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.11"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please help me I have search things to do but its still not working....
The error log already tells you:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.3.0 and higher
but you have
root project 'BreatherApp' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71
Then you just need to update your Kotlin version, which is one line inside build.gradle inside your 'BreatherApp' module, to a 1.3.0 or newer version.
The error log already tells you:
Failed to resolve: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.30
There is no 1.3.30 of kotlin-stdlib-jdk7, but a list of 1.3.30-dev-xxxx and 1.3.30-eap-xx. Choose the version you need (maybe 1.3.11 as your root build.gradle said), edit the module build.gradle.
Update: Please clarify project build.gradle and module build.gradle
I trying to use api.ai in a android project. So I download the Android Studio 2.3.3 create a new blank project to use android 5.0 o higher so I go here and put the dependencies
compile 'ai.api:sdk:2.0.7#aar'
// api.ai SDK dependencies
compile 'com.android.support:appcompat-v7:23.2.1'
But only to put the dependencies I got the error:
Error:(9, 0) Gradle DSL method not found: 'compile()' Possible
causes:The project 'ChefBot' may be using a version of the
Android Gradle plug-in that does not contain the method (e.g.
'testCompile' was added in 1.1.0). Upgrade
plugin to version 2.3.3 and sync projectThe project
'ChefBot' may be using a version of Gradle that does not contain the
method. Open Gradle wrapper
fileThe build file may be missing a Gradle plugin. Apply Gradle plugin
How can I fix this?
this is my build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
apply plugin: 'com.android.application' // put this and don`t work
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
compile 'ai.api:sdk:2.0.7#aar'
compile 'com.android.support:appcompat-v7:23.2.1'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If i have an Android app developed using Android Studio is it possible to link the ExoPlayer library (https://github.com/google/ExoPlayer) straight from github using graddle?
It would be handy not to manually have to download the library and copy it into my project every time it's updated by the ExoPlayer team.
I have tried adding this to the build.gradle in my module.
repositories {
mavenCentral()
maven { url 'https://raw.github.com/google/ExoPlayer' }
}
dependencies {
compile 'com.google.android.exoplayer'
}
But i get an error about the module notation being invalid...
It is now possible to add ExoPlayer as a jCenter dependency via gradle!
repositories {
mavenCentral()
jcenter()
}
dependencies {
...
compile 'com.google.android.exoplayer:exoplayer:r1.4.1'
}