Android Studio won't stop asking for appcompat-v23 - android

I do not want to use v23, I want to use v22. I have v22 specified everywhere, but when I try to sync the gradle file, I get:
Error:Failed to resolve: com.android.support:appcompat-v7:23.0.0
Install Repository and sync project
Open File
Show in Project Structure dialog
So I click Open File, and it opens the app build.gradle:
apply plugin: 'com.android.application'
android {
signingConfigs {
config {
<snip>
}
}
compileSdkVersion 'Google Inc.:Google APIs:22'
buildToolsVersion '22.0.1'
defaultConfig {
applicationId 'com.global.android.cwa'
minSdkVersion 9
targetSdkVersion 20
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
applicationIdSuffix ".debug"
}
}
productFlavors {
Pro {
applicationId "com.global.android.pwa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Simple {
applicationId "com.global.android.swa"
signingConfig signingConfigs.config
targetSdkVersion 22
}
Beta {
applicationId "com.global.android.pwab"
signingConfig signingConfigs.config
targetSdkVersion 22
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-identity:8.3.0'
compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
}
If I choose to Install Repository and sync project, then I get errors during compilation along the lines of:
android-apt-compiler: [appcompat] D:\Android SDK\extras\android\support\v7\appcompat\res\values-v23\styles_base.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
And I can see in external libraries that it is including appcompat-v23.
Can someone please help me exercise the demon out of gradle that keeps trying to include appcompat v23 in my project?

You are using
compile 'com.google.android.gms:play-services:9.0.0'
This version has a dependency with support libraries v23.
You have to compile with API23.
compileSdkVersion 23

Related

Gradle 'MyApp' project refresh failed. A strange kind of error

I have recently update Android Studio to Android Studio 2.1.2. I have stuck with a strange error. Error is printed below. This happens when I just create new android studio project.
Gradle 'myapp' project refresh failed
Error:No toolchains found in the NDK toolchains folder for ABI with prefix: aarch64-linux-android
Note : I am using java8 and the module gradle.build file looks like below. Since I have just created the project I have not added any NDK related files.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.myapp"
minSdkVersion 11
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'
}

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

I keep getting more than one library with package name [Android]

I keep getting
Error:Execution failed for task ':streamHdtv2:processDebugResources'.
> Error: more than one library with package name 'com.facebook'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
error. I have checked my build.gradle several times but I couldnt find any duplicate entry for package Facebook.
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.flashlight"
minSdkVersion 15
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':initActivity')
compile 'com.android.support:support-v4:22.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile project(':facebook')
}
You are importing one library twice
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile project(':facebook')
So remove one of the line and it will work.
and for more information have a look at below link
A library uses the same package as this project after importing Facebook SDK
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
compile project(':facebook')
Comment out any of the above line.
Use this
Error:Execution failed for task ':streamHdtv2:processDebugResources'.
> Error: more than one library with package name 'com.facebook'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
error. I have checked my build.gradle several times but I couldnt find any duplicate entry for package Facebook.
My build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.example.flashlight"
minSdkVersion 15
targetSdkVersion 21
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':initActivity')
compile 'com.android.support:support-v4:22.2.0'
compile 'com.google.android.gms:play-services:+'
compile 'com.facebook.android:facebook-android-sdk:4.6.0'
}

Error: more than one library with package name

The Android-studio post a Error
Error:Execution failed for task ':android:processDebugResources'.
Error: more than one library with package name 'com.tencent.weibo.sdk.android.component'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0
Below is my content of build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion "21.1.1"
defaultConfig {
applicationId "com.insthub.ecmobile"
minSdkVersion 8
targetSdkVersion 17
testApplicationId "com.insthub.ecmobile.test"
testInstrumentationRunner "android.test.InstrumentationTestRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile project(':androidSDK')
compile project(':alipay_lib')
compile project(':eventBus')
compile 'com.android.support:support-v4:19.1.0'
compile files('libs/Msc.jar')
compile files('libs/UPPayAssistEx.jar')
compile files('libs/UPPayPluginExPro.jar')
compile files('libs/alipay.jar')
compile files('libs/commons-httpclient-3.0.1.jar')
compile files('libs/libammsdk.jar')
compile files('libs/pushservice-3.2.0.jar')
compile files('libs/umeng_sdk.jar')
compile files('libs/universal-image-loader-1.8.6-with-sources.jar')
compile files('libs/weibosdkcore.jar')
compile project(':androidSDKComponent')
}
I can't find "com.tencent.weibo.sdk.android.component"

Project not works when I'm adding test support library

I want use JUnit 4 framework in my android app and for that reason I added test support library and now my project now working. Here is the stack trace:
Error:Execution failed for task ':app:packageDebug'.
> Duplicate files copied in APK LICENSE.txt
File 1: C:\Users\Damian\.gradle\caches\modules-2\files-2.1\junit\junit-dep\4.10\64417b3bafdecd366afa514bd5beeae6c1f85ece\junit-dep-4.10.jar
File 2: C:\Users\Damian\.gradle\caches\modules-2\files-2.1\junit\junit-dep\4.10\64417b3bafdecd366afa514bd5beeae6c1f85ece\junit-dep-4.10.jar
This is my build.gradle file:
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "project.myapp.damian.myapp"
minSdkVersion 14
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'com.android.support.test:testing-support-lib:0.1'
compile 'com.android.support.test.espresso:espresso-core:2.0'
compile 'com.android.support.test.uiautomator:uiautomator-v18:2.0.0'
}
Look here and read the error message regarding the ignoring of license files.
Pasted from android studio.
You can ignore those files in your build.gradle:
android {
packagingOptions {
exclude 'LICENSE.txt'
}
}

Categories

Resources