Android Studio prevent build API23, I want only API22 - android

How can I stop building for API23? I have many libraries, reduced probably all to API22 from API23. Still I have problems, when want to sync my gradle, it is showing errors in V23 styles.
Is there a way to disable building V23? I don't want to use API23. Don't tell me to update my project to API23 because in my app, permission checking is not necessary. It's inside company app (not for Google Play) and permission dialogs are not necessary.
This is error
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Here is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.0"
defaultConfig {
applicationId "com.pongodev.layartancepapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 2
versionName "2.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:recyclerview-v7:22.1.0'
compile('com.mikepenz:materialdrawer:4.4.6#aar') {
transitive = true
}
compile 'com.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:7.3.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
testCompile 'junit:junit:4.12'
compile 'com.mcxiaoke.volley:library:1.0.0'
compile 'com.github.mrengineer13:snackbar:1.0.0'
compile 'com.marshalchen.ultimaterecyclerview:library:0.3.18'
compile 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
compile 'com.mikepenz:google-material-typeface:2.2.0.3.original#aar'
compile 'com.github.AndroidDeveloperLB:MaterialPreferenceLibrary:1'
}

You can define compileSdkVersion and buildToolsVersion to 22 in build.gradle
compileSdkVersion = 'Google Inc.:Google APIs:22'
buildToolsVersion = "22.0.0"

These steps works for you:
1.Click build.gradle
2.Change compileSdkVersion 23 to 22
3.Change targetSdkVersion 23 to 22
follow pics
See Picture for clear understanding

Related

Cannot resolve method: CameraSource.Builder.setAutoFocusEnabled

I use Vision API to scan barcode. It's almost done, except auto-focus. I follow the guide in this link: https://developers.google.com/android/reference/com/google/android/gms/vision/CameraSource.Builder, use setAutoFocusEnabled method and get an error: "Cannot resolve method 'setAutoFocusEnabled(boolean)'"
My Android studio version: 2.1.1
JRE: 1.8.0
file build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "***"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.google.android.gms:play-services:7.8+'
}
You are reading newer documentation than the library you are using.
If you want the newer features, then upgrade.
Replace com.google.android.gms:play-services:7.8+
With com.google.android.gms:play-services-vision:10.0.0, or some other, later version than 7.8.
See about selective compilation. It will make your app smaller, and build faster.

Unable to sync gradle

I get error messages when I try to add recyclerview and cardview dependencies to my build.gradle. Here is my build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.truewebdev.applytheme"
minSdkVersion 17
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support.recyclerview-v7:23.2.0'
compile 'com.android.support.cardview-v7:23.2.0'
}
Here are the error messages:
If I try to install repository, I get the following:
What is wrong here?
Did you download the Android Support Repository from the SDK Manager?
From android docs:
Make sure you have downloaded the Android Support Repository using the SDK Manager.
http://developer.android.com/tools/support-library/setup.html#libs-with-res

Using Google Maps API in Android Studio

Hey guys I've installed the SDK for google play services and have added the dependancies however I still get the error:
Failed to find: com.google.android.gms:play-services-maps:6.5+
Is there something I'm missing?
Heres my dependencies file:
apply plugin: 'com.android.application'
apply plugin: 'android'
android {
compileSdkVersion 21
buildToolsVersion "19.1.0"
defaultConfig {
applicationId "team08.httpapp"
minSdkVersion 17
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.android.support:appcompat-v7:20.+'
compile 'com.google.android.gms:play-services:6.5.+'
compile 'com.google.android.gms:play-services-maps:6.5.+'
}
Make sure the "Google Repository" is installed in your SDK manager.
Based on this Google blog post:
http://android-developers.blogspot.co.at/2014/12/google-play-services-and-dex-method.html
I would remove compile 'com.google.android.gms:play-services:6.5.+' and change the other line to compile 'com.google.android.gms:play-services-maps:6.5.87'.

Android Studio support v4

I know this question was asked several times, but none of the answers helped me so far...
All I did was generating a preferences screen with Android Studio and now it tells me that NavUtils cannot be found. Even though my build.gradle looks right (I guess):
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '20.0.0'
defaultConfig {
applicationId "com.brobox.getyourshitdone"
minSdkVersion 15
targetSdkVersion 19
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
compile 'com.android.support:support-v4:20.0.+'
compile files('libs/android-support-v4.jar')
}
I hope someone can help :/
Edit:
Just created a new project on my laptop and generated the SettingsActivity again. This is my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.brobox.getyourshitdone"
minSdkVersion 14
targetSdkVersion 19
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.android.support:support-v13:20.0.0'
compile 'com.android.support:support-v4:20.0.0'
}
Still got the same error <.<
You have to remove this line implementation files('libs/android-support-v4.jar') and you have to remove this file.
The support library should only be added by gradle. And you have done that in this line implementation 'com.android.support:support-v4:20.0.+'.
YourtargetSdkVersion and your compileSdkVersion are also weird. Those values are not supported with the L developer preview.
compileSdkversionshould be 'android-L', targetSdkVersion should be 'L'.
Press this button, and clean rebuild project.
And add to dependencies :
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:cardview-v7:+'
compile 'com.android.support:recyclerview-v7:+'
compile 'com.android.support:palette-v7:+'
}
Well some time passed and now it works! I don't know what solved it exactly but I did the following:
I updated to Android Studio 0.8.12 manually, because that was the only way to update it
In a new project I tried to manually add a SettingsActivity and therefore added support-v4 to my repositories
Thanks for all your help on this silly question...

support:CardView minimum SDK?

I'm trying to add CardView support into my app for devices lower than Android L by adding the line:
compile 'com.android.support:cardview-v7:21.+'
I've then added compileSdkVersion and targetSdkVersion to 'android-L'
Now, unless I am mistaken, I thought that this would have built on my Nexus 5 in 4.4.4, however I get the error
Failure [INSTALL_FAILED_OLDER_SDK]
Am I missing something or misunderstood this? Full build.gradle below:
apply plugin: 'com.android.application'
android {
compileSdkVersion 'android-L'
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.gh.app"
minSdkVersion 15
targetSdkVersion 'android-L'
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
wearApp project(':wear')
compile 'com.google.android.gms:play-services-wearable:+'
compile 'com.android.support:support-v4:20.0+'
compile files('libs/TalkClient.jar')
compile 'com.android.support:cardview-v7:21.+'
}
While CardView and RecyclerView are both new widgets being added to the support library (and therefore will be available on API 7+ devices), during the developer preview they are limited to Android L devices only.

Categories

Resources