I can't see the design page and a few other issues - android

After I update the android studio to version 3.0.1, when I open my project. I have get some error and I can't see the design page but if I run the app. I have no issue.
First this error:
Warning:The specified Android SDK Build Tools version (23.0.3) is
ignored, as it is below the minimum supported version (26.0.2) for
Android Gradle Plugin 3.0.1. Android SDK Build Tools 26.0.2 will be
used. To suppress this warning, remove "buildToolsVersion '23.0.3'"
from your build.gradle file, as each version of the Android Gradle
Plugin now has a default version of the build tools.
The second error:
Failed to load AppCompat ActionBar with unknown error.
This is my build.gradle(app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "ir.hosseinyha.kardoon"
minSdkVersion 16
targetSdkVersion 23
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:23.0.3'
compile 'com.github.bumptech.glide:glide:3.7.0'
testCompile 'junit:junit:4.12'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
Tanks for help

You should upgrade all your com.android.support dependencies to minimum supported versions (26.0.2+).
Also change tarcompileSdkVersion, buildToolsVersion, targetSdkVersion to actual values (26+ but better to support latest - 28). Note that dependencies should have same version as buildTools and targetSdk.

Related

"All com.android.support libraries must use the exact same version specification" when compiling android.support:appcompat-v7:25.2.0

After updating Android Studio to Version 3.1.2 I'm getting an error in my app's build.gradle:
All com.android.support libraries must use the exact same version specification (...). Found versions 28.0.0-alpha1, 26.1.0. Examples include com.android.support:asynclayoutinflater:28.0.0-alpha1 and com.android.support:animated-vector-drawable:26.1.0
This is my gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "org.hopto.****.musicplayer"
minSdkVersion 23
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.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.cleveroad:audiowidget:0.9.0'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.android.support:recyclerview-v7:+'
testCompile 'junit:junit:4.12'
}
I've tried solving this by adding the following lines:
compile 'com.android.support:asynclayoutinflater:25.0.0'
compile 'com.android.support:animated-vector-drawable:25.0.0'
I've also tried this with different version, eg 25.2.0 and 25+, but none of this worked.
You are using the following support libraries:
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:recyclerview-v7:+' //error here
As you can see, your recyclerview library is using '+' which is the latest version available, that is 28.0.0-alpha1 or 26.1.0 (stable). For the rest you are using 25.2.0, thus the error with the version mismatch.
The solution is to either change recyclerview version to 25.2.0 or everything to 26.1.0 (including the recyclerview).
Side note: you should avoid using '+' in version numbers as you may come up with unexpected behavior when your libraries update.

Several Gradle errors in Android Studio

I try to use FireBase in my App but I get several Gradle error messages:
First, look at my build gradle (module app):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.user.finalchat"
minSdkVersion 22
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 {
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'
})
implementation 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.firebase:firebase-core:12.0.1'
compile 'com.firebaseui:firebase-ui-database:3.3.0'
compile 'com.android.support:design:26.0.0'
compile 'com.google.firebase:firebase-auth:12.0.1'
compile 'com.firebaseui:firebase-ui:3.3.0'
implementation 'com.firebaseui:firebase-ui-auth:3.3.0'
testCompile 'junit:junit:4.12'
}
When I sync my project, it throws me this error message:
Error:(27, 0) Gradle DSL method not found: 'implementation()' Possible
causes:The project 'Finalchat' 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).
The project 'Finalchat' may be using a version of Gradle that does not contain the method.
The build file may be missing a Gradle plugin
Edit: I read some questions regarding this problem, but my problem was not solved.
update build-tools via SDK Manager, then update your build.gradle to use the most recent buildToolsVersion (27.0.3 (stable), 28.0.0 (preview) atm).
Also replace all compile with implementation, the IDE will give you a warning. Also you may need to update your dependencies.
Do not downgrade, as this will break some day later.

android unable to build the project showing install missing files

Codes of build.gradle(Module.app)
After,creating my project it was showing incompatible version.So,Found in internet to modify my gradle file but after modifying gradle file and changing compile sdk from 26 to 27 it's showing install the missing file .
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.2"
defaultConfig {
applicationId "com.example.thelost.fisp_beta10"
minSdkVersion 15
targetSdkVersion 27
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:27.+'
compile 'com.android.support:recyclerview-v7:27.+'
compile 'com.android.support:design:27.+'
compile 'com.android.support:cardview-v7:27.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
Error: Showing in my project
Click on the error if any, it will automatically download.
From the docs
You should always keep your Build Tools component updated by
downloading the latest version using the Android SDK Manager. If
you're using Android plugin for Gradle 3.0.0 or higher, your project
automatically uses a default version of the build tools that the
plugin specifies. To use a different version of the build tools,
specify it using buildToolsVersion in your module's build.gradle,
The latest buildToolsVersion is 27.0.1
So change
buildToolsVersion "27.0.2"
to
buildToolsVersion "27.0.1"
and sync your project.
try this in app level gradle
repositories {
maven {
url "https://maven.google.com"
}
}

Android Studio - Error: Android Source Generator: Android SDK is not specifed

I'm getting "Error: Android Source Generator:[app_name] Android SDK is not specifed" in Android Studio while trying to Build Project.
I have Android Studio 1.0.2 RC4 version.
What have been done:
SDK installed ith SDK Manager
Project Structure -> SDK; I have added there minimum and target SDK as well
updated build.gradle
build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.byoutline.pinafood"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jakewharton:butterknife:6.0.0'
compile 'com.squareup.retrofit:retrofit:1.6.1'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'org.glassfish:javax.annotation:3.1.1'
compile 'com.squareup:otto:1.3.5'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.squareup.dagger:dagger:1.2.2'
provided 'com.squareup.dagger:dagger-compiler:1.2.1'
compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
compile 'com.jakewharton.timber:timber:2.4.+'
}
Go to Project Structure->SDK Location and make sure the path is set correctly.
Okay, so I had to upated build:gradle to 1.0.0 (only by changing those number in build.gradle file and change from runProguard to minifyEnabled.

Android studio : Error : Module version com.android.support:support-v13:13.0.0 depends on libraries but is not a library itself

I try to add this lib (https://github.com/daimajia/AndroidImageSlider) to my project. I added the compile library in my gradle file, but i get an error :
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.pp.myapp"
minSdkVersion 16
targetSdkVersion 20
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.2'
compile 'com.iangclifton.android:floatlabel:1.0'
compile 'com.google.android.gms:play-services:5.0.89'
compile "com.android.support:support-v4:+"
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.0.9#aar'
}
And i get this error :
Error:Module version com.android.support:support-v13:13.0.0 depends on libraries but is not a library itself
Try adding this dependency:
compile 'com.android.support:support-v13:19.0.+'
You have to install the Android Support Library from the SDK, too.
I got the same error with an oauth library. It was fixed after a while when, tired of implementing new changes to the build.gradle like changing the support libraries, I discarded the changes on the file (via Sourcetree). It synchronized and automatically got fixed.
(Android Studio) It's a kind of magic.

Categories

Resources