I am trying to add the library into the Kotlin but it is not getting proper install in it.
Following error I am getting while importing the library, please check it
Error: Could not find com.android.tools.build:gradle:2.3.1.
Searched in the following locations:
file:/C:/Program Files/Android/Android Studio Preview/gradle/m2repository/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.pom
file:/C:/Program Files/Android/Android Studio Preview/gradle/m2repository/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.jar
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.3.1/gradle-2.3.1.jar
Required by:
project: slidingmenulib
I am using the following project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.3-2'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And my module build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 26
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.zargow.kotlin"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:26.0.0-beta2'
testImplementation 'junit:junit:4.12'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:recyclerview-v7:26.0.0-beta2'
compile 'com.github.bumptech.glide:glide:3.8.0'
compile 'org.jetbrains.anko:anko-design:0.8.3'
compile 'com.squareup.okhttp3:okhttp:3.8.1'
compile 'com.android.support:cardview-v7:26.0.0-beta2'
compile 'com.android.support:design:26.0.0-beta2'
compile 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:design:26.0.0-beta2'
}
I am using the library for sliding menu, please check this. I need to import this library into my kotlin project but getting error.
In progect gradle file use
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven { url "http://jzaccone.github.io/SlidingMenu-aar" }
}
}
and in app gradle add
dependencies {
....
compile 'com.jeremyfeinstein.slidingmenu:library:1.3#aar'
}
Related
version conflict either by updating the version of the google-services plugin or updating the version of com.google.android.gms to 11.0.4.
i tried this(Conflict with firebase 11.8.0 and google-services plugin 3.1.2) solution but failed
Messages Gradle Build
build.Gradle(Project Level)
build.Gradle(App level)
App level gradle code
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.shadow.pakistannetcafe"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.0.2'
compile 'com.android.support:design:26.0.2'
compile 'com.android.support:support-v4:26.0.2'
compile 'com.google.firebase:firebase-core:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-auth:9.2.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Project Level Gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Keep all the firebase dependencies same version so use (in app-level gradle )
compile 'com.google.firebase:firebase-auth:11.8.0'
instead of
compile 'com.google.firebase:firebase-auth:9.2.1'
Error:Failed to resolve: com.android.support:customtabs:26.0.1
Error:(44, 13) Failed to resolve: com.google.firebase:firebase-auth:11.0.4
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "pritish.sawant.com.simplypubliccloud"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// FirebaseUI
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-config:11.0.4'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.16.0'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
build.gradle(project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am using Firebase,Facebook libraries.I am getting the following errors.I tried everything.Please help me if you know how to resolve this error.I am also receiving the following error
Error:(41, 13) Failed to resolve: com.android.support:design:26.0.1
I tried clicking on Install Repository and sync project,but nothing happens.
Error:Failed to resolve: com.android.support:customtabs:26.0.1
Error:(41, 13) Failed to resolve: com.android.support:design:26.0.1
You should change your buildToolsVersion version .
Don't
buildToolsVersion "25.0.3"
Do
buildToolsVersion "26.0.1"
Then Clean-Rebuild-Run .
Add one more Dependency to your list.
compile 'com.google.firebase:firebase-core:11.0.4'
Then clean and rebuild your project.
Maybe you can try to change the repositories just as the demo instruction--->
buildscript {
repositories {
jcenter()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
google()
maven { url 'https://maven.fabric.io/public' }
}
}
I am using from kotlin but when I sync it in my project get me bellow error :
Error:Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:1.1.2-3.
Searched in the following locations:
file:/D:/android-studio/gradle/m2repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.pom
file:/D:/android-studio/gradle/m2repository/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.jar
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.pom
https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.1.2-3/kotlin-gradle-plugin-1.1.2-3.jar
Required by:
project :
Here is my build.gradle(Module) :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "ir.baslam.kotlinme"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
repositories {
mavenCentral()
}
And here is my build.gradle(project) :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-3'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
ext.kotlin_version = '1.1.2-3'
'1.1.2-3' version is not available in jcenter repo neither it is available in your file system.
As I check the latest version 1.1.2-2 is available in jcenter that is last update on Apr 28, 2017 so use 1.1.2-2 version instead of 1.1.2-3.
ext.kotlin_version = '1.1.2-2'
The Kotlin Gradle plugin version which you set is not still available on repository.
Try setting to any other version like:
ext.kotlin_version = '1.1.1'
I need to import firebase-ui for my app but I am getting this error when I sync gradle
Error:Could not find com.google.services.gms:google-services:3.0.0.
Searched in the following locations:
file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom
file:/D:/NewAndroid/androidStudios/mew/gradle/m2repository/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar
https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.pom
https://jcenter.bintray.com/com/google/services/gms/google-services/3.0.0/google-services-3.0.0.jar
Required by:
project :
I just downloaded android studio so everything is up to date and everything works until I try to import firebase-ui.
build.gradle(Project:ChatApp)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
classpath 'com.google.services.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.emilythacker.chatapp"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
//Add library
compile 'com.android.support:design:25.3.1'
compile 'com.firebaseui:firebase-ui:1.2.0'
}
In your project build.gradle file, this:
classpath 'com.google.services.gms:google-services:3.0.0'
should be:
classpath 'com.google.gms:google-services:3.0.0'
To resolve the twitter error, update your project build.gradle:
allprojects {
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' } // <= ADD THIS
}
}
It's needed by Firebase Auth UI.
I have a working Android project using Kotlin version 1.0.0-beta-1038 in Android Studio.
I can run it using Kotlin in different parts, it compiles and works in the emulator but when I tried to use ReadWriteProperty it gives this error message:
Unresolved reference: ReadWriteProperty
Class called PreferenceUtils.kt:
build.grade (Module: app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.droidcba.oculto"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.android.support:recyclerview-v7:23.0.1'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1'
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1'
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'io.reactivex:rxjava:1.0.14'
}
buildscript {
ext.kotlin_version = '1.0.0-beta-1038'
repositories {
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
}
}
repositories {
mavenCentral()
}
build.grade (Module: myProject)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Please let me know if you need more info. Thanks!
Solved! I have to upgrade the Kotlin Plugin
from Android Studio. It started to recognise "ReadWriteProperty".