Reputation: 1195
I'm getting this error in my Kotlin project:
Here is my app's Gradle files:
I haven't really done anything to the project yet except add Kotlin and Anko dependencies. Not sure what's happening...
Upvotes: 2
Views: 1314
Reputation: 2915
This is a well known issue with Anko. It is mentioned here.
You can try to exclude implicit com.google.android:android
dependency from Anko's dependencies:
compile("org.jetbrains.anko:anko-appcompat-v7:$anko_version") {
exclude group: 'com.google.android', module: 'android'
}
(Keep in mind as you are using separate Anko libraries - you may need to use exclusion in multiple pleces).
You can also try to update Gradle plugin:
classpath 'com.android.tools.build:gradle:3.0.0-alpha2'
Upvotes: 2
Reputation: 478
AFAIK, its Google Repository which is missing. As you can see the ide itself is informing you about it.
Failed to resolve: com.google.android:android.2.3.1 which is Google Repository.
If you are connected to internet then simply click on Install Repository and Sync project in the Gradle Sync window. It will download the google repository and sync your project.
Upvotes: 0
Reputation: 3404
Add like this too. flavorDimensions "default"
productFlavors { debug { dimension "default" ... }
release { dimension "default" ... }
foss { dimension "default" ... } }
Upvotes: 0
Reputation: 20140
Add the dependency inside you app-level app module :
// Anko
compile 'org.jetbrains.anko:anko-sdk15:0.8.2' // sdk19, sdk21, sdk23 are also available
compile 'org.jetbrains.anko:anko-support-v4:0.8.2' // In case you need support-v4 bindings
compile 'org.jetbrains.anko:anko-appcompat-v7:0.8.2' // For appcompat-v7 bindings
Upvotes: 1
Reputation: 9
As In your screenshot I can see that while adding Anko dependencies you didn't mention the Anko version , kindly mention that it should work fine post that.
Upvotes: 0