How to instamojo integrated in android - android

Im new for android, I want to add payment option in my app. So, I used instamojo. Im include instamojo library in gradle file. But gradle file throw error.
Error:
Error:Failed to resolve: in.juspay:godel:0.6.11.0823
My gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:23.2.0'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.android.support:appcompat-v7:23.2.0'
compile 'com.android.support:recyclerview-v7:23.2.0'
compile 'com.loopj.android:android-async-http:1.4.7'
compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
compile('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'org.hamcrest', module: 'hamcrest-core'
}
compile 'com.android.support:multidex:1.0.0'
compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
compile 'com.android.support:design:23.1.1'
compile 'com.google.gms:google-services:3.0.0'
compile 'com.google.android.gms:play-services-gcm:8.4.0'
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.instamojo:android-sdk:1.2.4'
}
If i run the instamojo sdk in separate application means working perfectly.If i integrate with my app means getting above gradle error.
Please, anyone help to resolve.
Thanks in advance.

Error:Failed to resolve: in.juspay:godel:0.6.11.0823
From here or here
You should have an allprojects block, that contains some lines like this
// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
And in app/build.gradle
dependencies {
// compile 'in.juspay:godel:0.6.12.0823' // maybe need this?
compile 'com.instamojo:android-sdk:1.2.4'
// your other dependencies
...
...
}
Also, this line needs not to be there. compile 'com.google.gms:google-services:3.0.0' It should be in the classpath of the buildscript dependencies block.
And 'com.android.support:design:23.1.1' should use 23.2.0 to match the other Android support versions.
Regarding "Manifest merger failed", you can search to find something similar, and start with removing this line, because it's redundant with the other dependencies.
compile 'com.android.support:support-v4:23.2.0'

// Add to build.gradle
repositories {
jcenter() // <-- should already be there
mavenCentral()
maven {
url "https://s3-ap-southeast-1.amazonaws.com/godel-release/godel/"
}
}
then add this in your manifest file
<meta-data android:name="instamojo.orderauth.url"
android:value="ur website name/access_token.php"
/>

Related

Not able to generate signed apk. duplicate entry: DragAndDropPermissionsCompat.class

While generating a signed apk I am experiencing this error:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v13/view/DragAndDropPermissionsCompat.class
One of the reference link said to update the dependencies so I did but still no help.
My gradle dependencies looks like:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:27.1.0'
compile 'com.android.support:design:27.1.0'
compile 'com.google.firebase:firebase-auth:11.6.0'
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.android.gms:play-services-auth:11.6.0'
compile 'com.google.android.gms:play-services-places:11.6.0'
compile 'com.google.android.gms:play-services-ads:11.6.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'agency.tango.android:material-intro-screen:0.0.4'
compile 'com.android.support:recyclerview-v7:27.1.0'
compile 'com.android.support:cardview-v7:27.1.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.afollestad.material-dialogs:core:0.8.6.1'
compile 'com.afollestad.material-dialogs:commons:0.8.6.1'
compile 'com.tumblr:remember:1.0.0#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.slider:library:1.1.5#aar'
compile 'com.wang.avi:library:2.1.3'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
compile 'com.wdullaer:materialdatetimepicker:3.5.1'
compile 'com.shawnlin:number-picker:2.4.5'
compile 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:1.2.0'
compile 'com.kofigyan.stateprogressbar:stateprogressbar:0.0.8'
compile 'com.github.jhonnyx2012:horizontal-picker:1.0.6'
compile 'com.zhihu.android:matisse:0.4.3'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
//debugCompile 'com.squareup.okhttp3:logging-interceptor:3.3.1'
testCompile 'junit:junit:4.12'
compile("com.github.hotchemi:permissionsdispatcher:3.2.0") {
// if you don't use android.app.Fragment you can exclude support for them
exclude module: "support-v13"
}
annotationProcessor "com.github.hotchemi:permissionsdispatcher-processor:3.2.0"
}
and at my project level gradle I am doing this:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url "https://jitpack.io"
}
maven { url "https://maven.google.com" }
}
}
I did not find any help on internet other than this link but still no progress.
This answer solved it. And this article helped to resolve the error.
Update your project level build.gralde to use newer gradle tools:
classpath 'com.android.tools.build:gradle:3.1.2' // or even newer
and remove this:
classpath 'com.google.gms:google-services:3.1.0'
lastly update your buildToolsVersion to 26.0.3
exit Android studio, clean, rebuild :)

Glide gradle and firebaseUI fail to sync

I am using glide and firebase to manage my upload and download image to show a user profile pic, i follow the github repo where it talks about the firebaseUI and the glide, at the begin when my project worked fine my app gradle was like that:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.firebase:firebase-storage:10.0.1'
testCompile 'junit:junit:4.12'
after reading the docs where it says that if i want to include the firebaseUI version i need to upgrade all the compiles related to firebase to 10.2.0, i did this:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.firebaseui:firebase-ui:1.2.0'
testCompile 'junit:junit:4.12'
}
but i keep getting a error on my first compile: compile 'com.android.support:appcompat-v7:25.2.0'
the error is the following:
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 25.2.0, 25.1.1. Examples include com.android.support:animated-vector-drawable:25.2.0 and com.android.support:cardview-v7:25.1.
my project gradle:
// 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.3.1'
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()
mavenCentral()
maven {
url 'https://maven.fabric.io/public'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
need some help here im confused about this error :S
first, this is not relevant with Glide library.
gradle says "this project has different versions of android support packages", so you must use all com.android.support packages with same version. for example your project has '25.2.0' and '25.1.1'.
How can I achieve this ? Put this block to app level build.gradle
android {
...
}
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '25.2.0'
}
}
}
}
dependencies {
...
}
you can say "But I just compile my all android support packages with same level which is 25.2.0". some libraries includes android support packages and 25.1.1 is coming from your dependency.

Google Play Services GCM

I try to add google analitics to my app but I get error in build.gradle:
Error: Execution failed for task ':app:mergeProductionDebugResources'.
\app\build\generated\res\google-services\production\debug\xml\global_tracker.xml: Error: Duplicate resources
but the wrong in my code:
This is my app level gradle
android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('src/main/java/libs/gson-2.2.4.jar')
compile files('src/main/java/libs/quickblox-android-sdk-chat-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-content-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-core-2.5.1.jar')
compile files('src/main/java/libs/quickblox-android-sdk-messages-2.5.1.jar')
compile files('src/main/java/libs/bugsense-3.5.jar')
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.google.android.gms:play-services:9.0.0'
compile 'com.google.android.gms:play-services-auth:9.0.0'
compile 'com.joooonho:selectableroundedimageview:1.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.7.0'
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile('com.crashlytics.sdk.android:crashlytics:2.6.5#aar') {
transitive = true;
}
compile 'com.android.support:support-v4:23.+'
compile 'com.android.support:design:23.+'
compile "com.splunk.mint:mint:5.0.0"
compile 'com.google.android.gms:play-services-analytics:9.0.0'
}
apply plugin: 'com.google.gms.google-services'
}
and this is my project level gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
Edit:
when I remove global_tracker.xml
the runOnUiThread in:
import static com.google.android.gms.internal.zzir.runOnUiThread;
not know!!!
Remove the global_tracker.xml from your xml folder, as the google-services plugin will automatically add all the required data from the google-services.json configuration file when building your app.

Unresolved reference: kotlinx - Kotlin 1-0-0-rc-1036

I'm working in an Android App and a few days ago I updated my Kotlin version from 1.0.0-beta-1103 to the release candidate 1.0.0-rc-1036 and now I can't run my app for something related to Kotlin Android Extensions.
I use the apply plugin: 'kotlin-android-extensions' just like the official blog says http://blog.jetbrains.com/kotlin/2016/02/kotlin-1-0-release-candidate-is-out/ but my app doesn't recognize any view from any layout.
This is what appears on the console:
Error:(20, 8) Unresolved reference: kotlinx
Error:Execution failed for task ':app:compileDebugKotlin'.
Compilation error. See log for more details
Please help me, I'm losing my mind!
Update:
This is my buildScript in globalbuild.gradle
buildscript {
ext {
kotlin_version = "1.0.0-rc-1036"
}
repositories {
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// The Fabric Gradle plugin uses an open ended version to react
// quickly to Android tooling updates
classpath 'io.fabric.tools:gradle:1.+'
}
}
The dependencies listed in the app build.gradle
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
// Google
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'com.android.support:cardview-v7:23.1.0'
compile 'com.android.support:design:23.1.0'
compile 'com.android.support:recyclerview-v7:23.1.0'
// Kotlin
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// Square
compile 'com.squareup.okio:okio:1.5.0'
compile 'com.squareup.retrofit:retrofit:1.9.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.squareup.picasso:picasso:2.5.2'
// ReactiveX
compile 'io.reactivex:rxjava:1.0.14'
compile 'io.reactivex:rxandroid:1.0.1'
compile 'com.jakewharton.rxbinding:rxbinding:0.3.0'
compile 'com.jakewharton.rxbinding:rxbinding-support-v4:0.2.0'
// DBFlow
kapt 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
compile "com.raizlabs.android:DBFlow-Core:2.2.1"
compile "com.raizlabs.android:DBFlow:2.2.1"
// Otros
compile 'de.hdodenhof:circleimageview:1.3.0'
// SQLite Assets Helper
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
// Crashlytics Kit
compile('com.crashlytics.sdk.android:crashlytics:2.5.2#aar') {
transitive = true
}
}
This is an import that I'm using:
import kotlinx.android.synthetic.main.activity_all_quizzes.*
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
should be defined in the project-local build.gradle file for now.
Your kotlin stdlib compile dependency should (at least while not stable) be the same as the kotlin android studio plugin version
...
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
...
buildscript {
ext.kotlin_version = '1.0.0-rc-1036'
...

Include dependency from Maven local repository on Android Studio Gradle

I think I'm stupid or I'm missing something -hope the latter- but I can't properly import a dependency.
I have the repository in ~/.m2/repository and inside the directory I can see the deploy.
The maven setting.xml has the
<localRepository>${user.home}/.m2/repository</localRepository>
Here is the gradle file:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':lib_facebook')
compile project(':lib_dslrdashboard')
apt "org.androidannotations:androidannotations:3.2"
compile 'org.androidannotations:androidannotations-api:3.2'
compile 'de.livereach:rpc-objects-android:1.0.0'//THIS IS THE LOCAL DEPENDENCY
compile 'com.android.support:appcompat-v7:22.0.0'
compile 'org.slf4j:slf4j-android:1.6.1-RC1'
compile 'org.springframework.android:spring-android-rest-template:1.0.1.RELEASE'
compile 'com.fasterxml.jackson.core:jackson-databind:2.3.2'
compile 'de.keyboardsurfer.android.widget:crouton:1.8.5#aar'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.3'
compile 'com.github.castorflex.smoothprogressbar:library:1.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.2.3#aar') {
transitive = true;
}
compile('com.twitter.sdk.android:twitter:1.4.0#aar') {
transitive = true;
}
}
I'm on Mac OSx 10.10
Thanks in advance!
Gradle doesn't look at your Maven local repository by default. You need to explicitly ask it to:
allprojects {
repositories {
jcenter()
mavenLocal() // add this line
}
}
Gradle DSL Docs for mavenLocal(): docs.gradle.org/…

Categories

Resources