I keep getting more than one library with package name [Android] - 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'
}

Related

Android Studio won't stop asking for appcompat-v23

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

Failed to resolve:com.loopj.android:android-async-http:1.4.8

I have downloaded jar file of Loopj library and placed it in libs folder. have tried many changes but getting same error. Can anyone please help me to solve this.
build.gradle :-
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.pratik.receivedsms"
minSdkVersion 16
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.2.0'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.loopj.android:android-async-http:1.4.8'
}
What worked for me is opening gradle terminal from android studio and executing the following command:
gradlew installarchives
It should also work without downloading the jar file.
Another note is that I am using version 1.4.5.
Good luck!

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"

Android Studio gives me Execution failed for task ':library:proguardRelease' error after updating to Android Studio 1.0.1

I updated my Android Studio to 1.0.1. I followed this tutorial http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0 and changed from runProguard to minifyEnabled true. I also changed it in my library project. When I tried to compile it gave me Error:Execution failed for task ':> java.io.FileNotFoundException: ProjectName\library\proguard-rules.txt (The system cannot find the file specified). I researched for that and I found a solution. I added blank proguard-rules.txt file into that folder. After trying to compile, it gave me even more errors. The main error now was that it cannot find symbol class PageIndicator, which is my library's class. I don't even know what can I do for that.
My project's build.gradle:
apply plugin: 'android'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.miesto.meniu"
minSdkVersion 9
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':library')
compile files('libs/volley.jar')
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:support-v4:21.0.0'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.0#aar'
compile('com.google.api-client:google-api-client-xml:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile('com.google.api-client:google-api-client-android:1.17.0-rc') {
exclude group: 'com.google.android.google-play-services'
}
compile 'com.google.apis:google-api-services-drive:v2-rev105-1.17.0-rc'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
My library's build.gradle:
apply plugin: 'com.android.library'
android {
compileSdkVersion 21
buildToolsVersion "20.0.0"
defaultConfig {
minSdkVersion 9
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:21.0.0'
}
What am I doing wrong?
I solved this problem when I deleted my library and added it again.

class android support v4 print helper has been already added to output

I just updated my android studio to the latest version with the new gradle version also, running my application gives me an error class android support v4 has been already added to the output don't know what is going wrong i check if there is a jar duplicated or a library duplicated couldn't find anything. here is my app:build.gradle
enter code here
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion '21.1.1'
lintOptions
{
checkReleaseBuilds false
//abortOnError true
}
defaultConfig {
applicationId "package name"
minSdkVersion 14
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes
{
release {
minifyEnabled true
proguardFile getDefaultProguardFile('proguard-android.txt')
}
}
dexOptions {
preDexLibraries = false
incremental true
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project('Libraries:UniversalImageLoader')
compile project('Libraries:facebook')
compile project('Libraries:pull-to-refresh')
compile files('Libraries/gcm.jar')
compile files('Libraries/quickblox-android-sdk-chat-2.0.jar')
compile files('Libraries/quickblox-android-sdk-core-2.0.jar')
compile files('Libraries/quickblox-android-sdk-messages-2.0.jar')
compile 'com.google.android.gms:play-services:6.1.71'
compile 'com.google.maps.android:android-maps-utils:0.3'
compile 'com.squareup.picasso:picasso:2.4.0'
compile "com.android.support:appcompat-v7:21.0.2"
}
I took of this
compile 'com.android.support:support-v4:21.0.2'
i thought its already included in the appcompat-v7 but it did not solve my issue yet
I downgraded my Android Studio version to 0.8.6 and the "Duplicate Copies" error disappear.
It isn't a perfect solution but for now and for me it is the unique solution currently.

Categories

Resources