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
}
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 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)
This project has been working for weeks. Yesterday, Android Studio pulled in some updates, and now gradle cannot find my play-services files. It has literally stopped building with no changes to the project - I didn't think this would happen with a gradle-based project.
gradle sync error
When I click on "Install Repository and sync project", another window opens with the message:
Ignoring unknown package filter 'extra-google-m2repository'Warning: The package filter removed all packages. There is nothing to install.
Please consider trying to update again without a package filter.
Here is my gradle file:
apply plugin: 'android-library'
repositories {
mavenCentral()
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
}
dependencies {
compile 'com.android.support:appcompat-v7:20.0.+'
compile 'com.android.support:support-v4:20.0.+'
compile 'com.google.android.gms:play-services-games:6.5+'
compile 'com.google.android.gms:play-services-plus:6.5+'
compile 'com.google.android.gms:play-services-appstate:6.5+'
}
android {
compileSdkVersion 20
buildToolsVersion '20'
}
Looking in my SDK manager, both "Google Repository" and "Android Support Repository" are installed.
SDK manager screen shot
It is possible that I have two different SDK's, but not sure how to tell if I do, and not sure how to remove the extra one if this is the issue.
Removing the "+" and specifying the specific version allows me to build again. I'm actually using 6.5.87, as 8.4.0 caused some other issue.