Why can't I add Google Cast Companion Library to my project? - android

Currently, my project uses the Cast Companion library from sources. Here are my dependencies in my build.gradle file:
dependencies {
compile files('../../external/commonlibs/json/json-io-2.6.0.jar')
compile fileTree(dir: '../../external/commonlibs/annotations', include: '*.jar')
compile fileTree(include: '*.jar', dir: 'src/main/libs')
compile project(':common')
compile project(':common_ui')
compile project(':android-google-play-services_lib-v22')
compile project(':android-CastCompanionLibrary-v22')
compile project(':adara-middleware')
compile project(':android-support')
compile project(':android-mediarouter')
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
testCompile fileTree(dir: '../../external/testlibs', include: '*.jar')
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2'
androidTestCompile 'com.android.support.test:rules:0.3'
}
I want to remove the line "compile project(':android-CastCompanionLibrary-v22')" and replace it with:
compile 'com.google.android.libraries.cast.companionlibrary:ccl:2.9.1'
When I do this, I get the following error:
Error:A problem occurred configuring root project 'Fling'.
> Could not resolve all dependencies for configuration ':_myCatapulTVeDebugApkCopy'.
> Could not find com.google.android.libraries.cast.companionlibrary:ccl:2.9.1.
Required by:
:Fling:unspecified
I am following the instructions from this link: https://github.com/googlecast/CastCompanionLibrary-android

Related

Error:(35) Error: Version must be at least 10.2.1 when targeting O [GradleCompatible]

My build gradle file, i am getting the above error on trying to build signed apk, which version is this error talking about?
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'com.android.support:cardview-v7:23.0.+'
compile 'com.google.firebase:firebase-core:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
compile 'com.google.firebase:firebase-messaging:9.4.0'
Replace this line with the following line
implementation 'com.google.firebase:firebase-messaging:11.0.4'

Failed to resolve com.android.support:support-compat:25.4.0

I am trying to include this library to my project by adding
compile 'jp.wasabeef:recyclerview-animators:2.2.7'
to the dependencies. When the graddle sync happens an error produced like below
Failed to resolve com.android.support:support-recycleriew-v7:25.4.0
Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0
The graddle dependencies looks like
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:recyclerview-v7:25.4.0'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-core:2.8.5'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.5'
compile 'com.android.support:support-core-ui:25.4.0'
compile 'com.android.support:support-compat:25.4.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.7'
}
What is wrong here?
Failed to resolve com.android.support:support-recycleview:25.4.0
There is no library by that name. There is com.android.support:recyclerview-v7:25.4.0.
Failed to resolve com.android.support:support-compat:25.4.0
Failed to resolve com.android.support:support-core-ui:25.4.0
These are in the new Google Maven repo. Add maven { url "https://maven.google.com" } to your repositories closure, as shown in the documentation.

ZipExcepton: duplicate entry: com/google/android/gms/internal/zzpi.class

I am running into this issue every time I am trying to run my project.
I am getting this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/internal/zzpi.class
Here is my build script:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.15.2'
}
}
apply plugin: 'com.android.application'
//Put Fabric plugin after Android plugin
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/commons-collections4-4.0.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/graphview-3.1.jar')
testCompile 'junit:junit:4.12'
compile project(':progresslibrary')
compile files('libs/gson-2.6.2.jar')
compile('com.crashlytics.sdk.android:crashlytics:2.6.2#aar') {
transitive = true;
}
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2'
apt 'com.github.hotchemi:permissionsdispatcher-processor:2.1.2'
compile 'com.android.support:multidex:1.0.0'
compile 'com.hrules:charter:1.4.0'
compile 'com.github.hotchemi:permissionsdispatcher:2.1.2'
//noinspection GradleCompatible
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15'
compile 'com.android.support:multidex:1.0.0'
compile 'com.hrules:charter:1.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'pl.droidsonroids.gif:android-gif-drawable:1.1.15'
compile 'com.github.hotchemi:permissionsdispatcher:2.1.2'
compile 'com.amazonaws:aws-android-sdk-core:2.+'
compile 'com.amazonaws:aws-android-sdk-s3:2.+'
compile 'eu.the4thfloor.volley:com.android.volley:2015.05.28'
compile 'com.facebook.android:facebook-android-sdk:4.0.0'
compile 'com.snappydb:snappydb-lib:0.5.2'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.wdullaer:materialdatetimepicker:2.2.0'
compile 'com.oguzdev:CircularFloatingActionMenu:1.0.2'
compile 'com.shamanland:fab:0.0.8'
compile 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.3.0'
compile 'com.android.support:design:23.2.0'
compile 'com.android.support:support-v4:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.android.support:cardview-v7:23.2.0'
compile 'org.jsoup:jsoup:1.9.1'
compile 'com.flurry.android:analytics:6.2.0'
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.github.danielemaddaluno.androidupdatechecker:library:1.0.2'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
}
android {
packagingOptions {
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE.txt'
}
}
apply plugin: 'build-announcements'
please tell me what is wrong with my build script
At a quick glance, I can tell you that the problem exists in Google Play Services. And I am going to guess that these all need to be the same version (grouped by same version here).
compile 'com.google.android.gms:play-services-analytics:8.4.0'
compile 'com.google.android.gms:play-services-plus:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-fitness:8.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.4.0'
compile 'com.google.android.gms:play-services-auth:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
In order to efficiently do that, you can define an ext block in you Gradle file for keeping the version numbers consistent.
Additional note: This line compile fileTree(include: ['*.jar'], dir: 'libs')... It says compile all JAR files in the libs/ directory, therefore, these lines are pointless, and you can remove them while you try to identify where the error occurs.
compile files('libs/commons-collections4-4.0.jar')
compile files('libs/YouTubeAndroidPlayerApi.jar')
compile files('libs/graphview-3.1.jar')
compile files('libs/gson-2.6.2.jar')
Sample build.gradle
ext {
// Variables to keep libraries consistent
supportLibrary = "23.2.0"
googlePlayServicesVersion = '9.4.0'
// Support Libraries dependencies
supportDependencies = [
design : "com.android.support:design:${supportLibrary}",
recyclerView : "com.android.support:recyclerview-v7:${supportLibrary}",
cardView : "com.android.support:cardview-v7:${supportLibrary}",
appCompatV7 : "com.android.support:appcompat-v7:${supportLibrary}"
]
googlePlayServicesDepends = [
analytics : "com.google.android.gms:play-services-analytics:${googlePlayServicesVersion}"
plus : "com.google.android.gms:play-services-plus:${googlePlayServicesVersion}"
location : "com.google.android.gms:play-services-location:${googlePlayServicesVersion}"
fitness : "com.google.android.gms:play-services-fitness:${googlePlayServicesVersion}"
appindexing : "com.google.android.gms:play-services-appindexing:${googlePlayServicesVersion}"
auth : "com.google.android.gms:play-services-auth:${googlePlayServicesVersion}"
gcm : "com.google.android.gms:play-services-gcm:${googlePlayServicesVersion}"
]
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// compile supportDependencies.appCompatV7
// compile supportDependencies.recyclerView
// recommended - includes those above
compile supportDependencies.design
// extras
compile supportDependencies.cardView
// The correct Volley library
compile 'com.android.volley:volley:1.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile "com.google.code.gson:gson:2.6.2"
// Google Play Services
compile googlePlayServicesDepends.location
// TODO: Add others
}

Cannot access android.support.v4.app.BaseFragmentActivityHoneycomb

I implemented an Android application using support.v7.app.AppcompatActivity. This application doesn't compile: when I hold my mouse cursor above the super key it shows the following error:
Cannot access android.support.v4.app.BaseFragmentActivityHoneycomb
I've a same problem.
And my resolution is:
Replace project dependencies:
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
}
with
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:support-annotations:24.0.0'
}
It works for me,good luck.
It seems a compile issue. Try to check File -> project structure ->project -> set Gradle version and Android plugn version,then rebuild the project.
I found out the hidden issue by the operation.

Android proguard same jar specified twice

I have a project with two dependency projects in the libraries folder. Both are libraries which i wrote.
Error:Execution failed for task ':app:proguardgmobileRelease'.
java.io.IOException: The same input jar [/Users/Jon/android-app-manager/app/libs/**] is specified twice.
The main project dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:recyclerview-v7:21.0.3'
compile 'com.android.support:cardview-v7:21.0.3'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.google.code.gson:gson:2.3'
compile 'commons-io:commons-io:2.0.1'
compile 'org.roboguice:roboguice:3.0.1'
provided 'org.roboguice:roboblender:3.0.1'
compile 'com.google.code.findbugs:jsr305:1.3.9'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile project(':android-commons')
compile project(':ormlitewrapper')
compile('com.crashlytics.sdk.android:crashlytics:2.2.2#aar') {
transitive = true;
}
}
The android-commons project dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.google.code.gson:gson:2.3'
compile 'commons-io:commons-io:2.0.1'
compile 'com.google.android.gms:play-services-base:6.5.87'
}
The OrmLiteWrapper project dependencies:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.j256.ormlite:ormlite-android:4.48'
compile 'com.j256.ormlite:ormlite-core:4.48'
compile project(':android-commons')
}
The main project compiles the 2 sub project and ormLiteWrapper compiles the android-commons as well. I was unable to remove the dependency and don't know where I can find the solution for the cyclic dependency. Should it be defined in one place and referenced in the other?
The issue only creates a conflict when generating a release APK.
Don't use -libraryjars or -injar or -oujar in your proguard file

Categories

Resources