Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved - java

I am integrating PayU payment gateway and I am get the following error:
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
"Cannot change configuration ':PayUMoneySDK-Android-master:classpath' after it has been resolved."
I am using Android Studio, latest version.
The following is the build Gradle code:
apply plugin: 'com.android.library'
android {
compileSdkVersion 20
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 14
targetSdkVersion 20
versionCode 2
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildscript {
repositories {
mavenCentral()
}
dependencies
{
classpath 'com.android.tools.build:gradle:1.2.3'
}
}
}
dependencies {
compile('de.keyboardsurfer.android.widget:crouton:1.8.+#aar') {
exclude module: 'support-v7'
compile 'com.android.support:appcompat-v7:18.0.+'
classpath 'com.android.tools.build:gradle:1.1.1'
}
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'de.greenrobot:eventbus:2.2.1'
compile 'com.loopj.android:android-async-http:1.4.6'
compile 'com.mobsandgeeks:android-saripaar:1.0.3'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile project(':CustomBrowser-release')
}
The error is showing in "classpath 'com.android.tools.build:gradle:1.2.3'"..
The below dependencies are PayU dependencies

Related

update google services from 9.0.0 to 10.0.1 Android studio 2.2

I get an error saying
Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 9.0.0.
I tried looking at https://bintray.com/android/android-tools/com.google.gms.google-services/ and com.google.gms:google-services:3.0.0 seems to be the latest. This is my project gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
And this is how my app gradle looks like
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "sk.tipos.paradox02.citaj"
minSdkVersion 11
targetSdkVersion 23
versionCode 27
versionName '2.003'
}
buildTypes {
release {
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt')
// signingConfig signingConfigs.release
}
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.google.android.gms:play-services-appindexing:9.8.0'
compile 'com.google.android.gms:play-services-analytics:10.2.0'
compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-crash:10.0.1'
compile 'com.google.firebase:firebase-ads:10.0.1'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
If I change the play services to 9.0.0 everything compiles fine. What am I missing here?
Have you idea how resolve problem?
Thanks
You are having this issue because Firebase was built using Google Play Services , so you can't use a version of Google Play Services higher than the version of Firebase.
Can you try :
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "sk.tipos.paradox02.citaj"
minSdkVersion 11
targetSdkVersion 23
versionCode 27
versionName '2.003'
}
buildTypes {
release {
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
// signingConfig signingConfigs.release
}
debug {
debuggable true
minifyEnabled false
multiDexEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt')
// signingConfig signingConfigs.release
}
}
productFlavors {
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.android.support:multidex:1.0.1'
}
apply plugin: 'com.google.gms.google-services'
Sorry for my english, hope it's help.
You are using different versions of dependencies.Update their version to match version of latest google services version.
e.g.
compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.android.gms:play-services-ads:10.2.0'
compile 'com.google.android.gms:play-services-appindexing:10.2.0'
compile 'com.google.android.gms:play-services-analytics:10.2.0'
compile 'com.google.firebase:firebase-core:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.google.firebase:firebase-ads:10.2.0'
Have you tried the solution given in this post: https://stackoverflow.com/a/37565535/3108709 . I had the same issue as you had, this solved it for me.
That's because you should always put the "apply plugin" clause at the bottom for google-services, since it looks for the already-added dependencies. Do it like this in your app-level gradle:
dependencies {
compile 'com.google.android.gms:play-services-ads:9.0.1'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
This is hidden in the Firebase documentation, but applies even if you don't use Firebase.
Note : Update Google Repository also.

Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating')

Good day guys,
May i know why my recycler cardview message log shown this error?
Does anyone encounter this error before?
D:\New folder\DrawerWithSwipeTabs\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating').
Error:(4, 42) No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating').
It automatically pop up to D:\New folder\DrawerWithSwipeTabs\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CardView" parent="Base.CardView">
<item name="cardBackgroundColor">?android:attr/colorBackgroundFloating</item>
</style>
</resources>
build.gradle (Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
build.gradle (Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.androidbelieve.drawerwithswipetabs"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:design:22.2.1'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
}
parent="Base.CardView"
this parent class is not introduce in sdk version 22.
To implement this you need to change your minSdk version and library version to sdk-version 23.
somthing like this.
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.androidbelieve.drawerwithswipetabs"
minSdkVersion 15
targetSdkVersion 23
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:recyclerview-v7:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:cardview-v7:23.2.1'
}

update the version of the google-services plugin or update com.google.android.gsm to 8.3.0

it gives me this error
"Error:Execution failed for task ':app:processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0."
Here is my build.gradle (app)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
applicationId "com.uti.magic"
manifestPlaceholders = [onesignal_app_id: "xxxxxxxxxxxxxxxxxxxxxxxxxxx",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
minSdkVersion 21
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.1'
compile 'com.google.android.gms:play-services-ads:8.3.0'
compile files ('libs/aspectjrt-1.7.3.jar')
compile files ('libs/isoparser-1.0-RC-27.jar')
}
buildscript {
dependencies {
// Add this line
classpath 'com.google.gms:google-services:2.1.2'
}
}
// Add to the bottom of the file
dependencies {
compile 'com.onesignal:OneSignal:3.+#aar'
// Required for OneSignal, even if you have added FCM.
compile 'com.google.android.gms:play-services-gcm:+'
// Required for geotagging
compile "com.google.android.gms:play-services-location:+"
// play-services-analytics is only needed when using 8.1.0 or older.
// compile 'com.google.android.gms:play-services-analytics:+'
}
apply plugin: 'com.google.gms.google-services'
Remove apply plugin: 'com.google.gms.google-services' at the top of build.gradle of app module.

DuplicateFileException with Android Studio when trying to import 2 jar files

I am trying to import two jar files to my Android Studio Project. But when i try to run the code. I get the following Error.
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate
files copied in APK META-INF/ECLIPSE_.RSA
File1: A:\Uni-mora-sem4\IOT\Project\ClientApp\AndroidClientV2\app\libs
\org.eclipse.paho.android.service-1.0.2.jar
File2: A:\Uni-mora-sem4\IOT\Project\ClientApp\AndroidClientV2\app\libs\org.eclipse.paho.client.mqttv3-1.0.2.jar
Gradle File is as Follows.........
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "iot.dulanga.com.androidclientv2"
minSdkVersion 13
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories {
maven {
url "https://repo.eclipse.org/content/repositories/paho-releases/"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile files('libs/org.eclipse.paho.android.service-1.0.2.jar')
compile files('libs/org.eclipse.paho.client.mqttv3-1.0.2.jar')
}
Any ideas why I get this error ??
This is because both the jars are containing META-INF/ECLIPSE_.RSA and thus while packing the apk, duplication is arising.
So try to add this in the app's build.gradle:
android {
packagingOptions {
exclude 'META-INF/ECLIPSE_.RSA'
}
}

Dagger 2: java.lang.NoSuchMethodError

Can't build project with Dagger 2 (Android Studio 1.3).
Step 1. Add dependencies to build.gradle
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
provided 'org.glassfish:javax.annotation:10.0-b28'
Full build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
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.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.mcxiaoke.volley:library:1.0.+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.android.support:design:22.2.+'
compile 'com.android.support:palette-v7:22.2.+'
compile 'com.afollestad:material-dialogs:0.7.8.1'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
compile 'org.androidannotations:androidannotations:3.0.+'
compile 'org.androidannotations:androidannotations-api:3.0.+'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile files('libs/gson-2.2.jar')
}
Step 2.
Just add annotation #Inject or #Module to code and get compile error.
Error:Execution failed for task ':app:compileDebugJava'.
java.lang.NoSuchMethodError: com.google.common.collect.Multimaps.filterKeys(Lcom/google/common/collect/SetMultimap;Lcom/google/common/base/Predicate;)Lcom/google/common/collect/SetMultimap;
Any ideas?
Update
I'm create new project.
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 22
buildToolsVersion "22.0.1"
defaultConfig {
minSdkVersion 15
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.1'
apt 'com.google.dagger:dagger-compiler:2.0'
compile 'com.google.dagger:dagger:2.0'
provided 'org.glassfish:javax.annotation:10.0-b28'
compile files('libs/gson-2.2.jar')
}
And it compile fine. When I add to libs guava-r07.jar I get like compile error. I think the problem relate with guava.
Solved
Remove guava-r07.jar from libs.
Add to build.gradle
compile 'com.google.guava:guava:13.0.1'

Categories

Resources