i am facing error while adding payumoney in app.
Here is error -
UNEXPECTED TOP-LEVEL EXCEPTION:
`com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
at com.android.dx.merge.DexMerger$6.updateIndex(DexMerger.java:484)
at com.android.dx.merge.DexMerger$IdMerger.mergeSorted(DexMerger.java:261)
at com.android.dx.merge.DexMerger.mergeMethodIds(DexMerger.java:473)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:161)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:188)
atcom.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java0)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:334)
at com.android.dx.command.dexer.Main.run(Main.java:277)
at com.android.dx.command.dexer.Main.main(Main.java:245)
at com.android.dx.command.Main.main(Main.java:106)`
Here is build.gradle(app) file code
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.xxxxxxxxxxx"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}}
repositories {
maven { url "https://jitpack.io" }}
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 'com.github.PhilJay:MPAndroidChart:v2.2.3'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.picasso:picasso:2.3.2'
compile project(':viewPagerLib')
compile project(':PayU-release')
compile project(':sdkui')
compile 'com.google.android.gms:play-services:8.4.0'}
here is build.gradle(project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// 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}
if i use multidex true in build.gradle, error solved but app crash on first screen.
Add the following dependency:
compile 'com.android.support:multidex:1.0.1'
Also, minifyEnabled true;
And then add the following in your application class:
#Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
Remove this
compile 'com.google.android.gms:play-services:8.4.0'
Add this
compile 'com.google.android.gms:play-services-location:8.4.0'
compile 'com.google.android.gms:play-services-analytics:8.4.0'
Related
I Want to add Firestore in app, my android studio version is 2.3.2, but i am unable to see firestore option in Firebase assistant, And when i am adding librar for Firestore:-
compile 'com.google.firebase:firebase-firestore:10.0.1'
it is showing me this error:-
Error:(32, 13) Failed to resolve: com.google.firebase:firebase-firestore:10.0.1
Please help me out with this problem !!
this is my app level build gradel file:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "in.anew.trysafeblog"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-firestore:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Please help me out !!!
build gradle file:-
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
//classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To solve this, please change the following lines of code:
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-firestore:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
to
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
And please also don't forget to add:
classpath 'com.google.gms:google-services:4.0.1'
To your build.gradle file. Please see here more info.
Use
on your app/build.gradle
compile 'com.google.firebase:firebase-firestore:17.0.2'
compile 'com.google.firebase:firebase-storage:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.2'
on your project/build.gradle
buildscript {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) { delete rootProject.buildDir }
Error:Failed to resolve: com.android.support:customtabs:26.0.1
Error:(44, 13) Failed to resolve: com.google.firebase:firebase-auth:11.0.4
build.gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "pritish.sawant.com.simplypubliccloud"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
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'
})
// FirebaseUI
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-database:11.0.4'
compile 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.google.firebase:firebase-messaging:11.0.4'
compile 'com.google.firebase:firebase-config:11.0.4'
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:26.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.16.0'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-auth:11.0.4'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
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.3.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 {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I am using Firebase,Facebook libraries.I am getting the following errors.I tried everything.Please help me if you know how to resolve this error.I am also receiving the following error
Error:(41, 13) Failed to resolve: com.android.support:design:26.0.1
I tried clicking on Install Repository and sync project,but nothing happens.
Error:Failed to resolve: com.android.support:customtabs:26.0.1
Error:(41, 13) Failed to resolve: com.android.support:design:26.0.1
You should change your buildToolsVersion version .
Don't
buildToolsVersion "25.0.3"
Do
buildToolsVersion "26.0.1"
Then Clean-Rebuild-Run .
Add one more Dependency to your list.
compile 'com.google.firebase:firebase-core:11.0.4'
Then clean and rebuild your project.
Maybe you can try to change the repositories just as the demo instruction--->
buildscript {
repositories {
jcenter()
mavenLocal()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenLocal()
google()
maven { url 'https://maven.fabric.io/public' }
}
}
My current Android Application was working fine with ButterKnife
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
I then added Realm and all my bindings fail with NPE
01-13 21:38:59.646 27712-27712/com.crucifix.software.coffeeshop D/ButterKnife: Looking up binding for com.crucifix.software.coffeeshop.MainActivity
01-13 21:38:59.647 27712-27712/com.crucifix.software.coffeeshop D/ButterKnife: Not found. Trying superclass com.crucifix.software.coffeeshop.BaseActivity
01-13 21:38:59.650 27712-27712/com.crucifix.software.coffeeshop D/ButterKnife: Not found. Trying superclass android.support.v7.app.AppCompatActivity
01-13 21:38:59.650 27712-27712/com.crucifix.software.coffeeshop D/ButterKnife: MISS: Reached framework class. Abandoning search.
These are my build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.jakewharton:butterknife-gradle-plugin:8.4.0'
classpath 'io.realm:realm-gradle-plugin:1.1.0'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.crucifix.software.coffeeshop"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.yarolegovich:lovely-dialog:1.0.4'
compile 'com.yqritc:recyclerview-flexibledivider:1.4.0'
compile group: 'com.thomashaertel', name: 'multispinner', version: '0.1.1'
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.1.0'
compile 'com.android.support:design:25.1.0'
compile 'com.android.support:recyclerview-v7:25.1.0'
compile 'com.google.firebase:firebase-database:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
How do I resolve this issue?
I think your project level gradle file is a mess. it should like something like this:
// 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.3'
classpath 'io.realm:realm-gradle-plugin:2.2.2'
// 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
}
While your app level build.gralde file should like something like this:
apply plugin: 'com.android.application'
apply plugin: 'realm-android'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "your.app.id"
minSdkVersion 21
targetSdkVersion 24
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:24.2.1'
compile 'com.android.support:recyclerview-v7:24.2.1'
compile 'com.android.support:cardview-v7:24.2.1'
compile 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
}
After updating android studio 2.2 I am getting compilation error. Can you please help me in this regard?
Error:Execution failed for task ':app:compileDebugJavaWithJavac'
My Gradle file is: (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:1.3.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
}
---------------------------------------------------------------------------
My Gradle file is: (Module)
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.test"
minSdkVersion 15
targetSdkVersion 23
versionCode 2
versionName "1.1"
}
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.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'commons-io:commons-io:1.3.2'
compile 'com.google.code.gson:gson:2.4'
compile 'de.hdodenhof:circleimageview:1.2.1'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.facebook.android:facebook-android-sdk:4.15.0'
}
I am trying to include a library in my project, according to the instructions on github I have include the following in my build.gradle file:
compile 'com.github.omadahealth.slidepager: slidepager: 2.2.4#aar'
But i get this
error
Top-level build file
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.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
}
Module:app Build file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.exampleapp"
minSdkVersion 14
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.1.1'
compile 'com.android.support:support-v4:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
compile 'com.android.support:palette-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.github.omadahealth.slidepager:slidepager:2.2.4#aar'
}
they use other libraries, they use other libraries dependencies, if u add
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1#aar'
compile 'com.github.orangegangsters:library:1.3.4#aar'
compile 'com.github.omadahealth.slidepager:slidepager:2.2.4#aar'
U get one Error:(91, 21) No resource found that matches the given name: attr 'tv_typeface'.
I sample to download them and add them to the library gradle?