I'm trying to login to Firebase with Android, I'm getting strange messages:
Code Picture Here
login.setOnClickListener(new View.OnClickListener() {
#Override
public void onClick(View view) {
final String Email,Pass;
Email=email.getText().toString();
Pass=pass.getText().toString();
if(!TextUtils.isEmpty(Email) && !TextUtils.isEmpty(Pass))
{
progressBar.setVisibility(View.VISIBLE);
if(Pass.length()>=6)
{
auth = FirebaseAuth.getInstance();
auth.signInWithEmailAndPassword(Email, Pass).addOnCompleteListener(new OnCompleteListener<AuthResult>() {
#Override
public void onComplete(#NonNull Task<AuthResult> task)
{
progressBar.setVisibility(View.INVISIBLE);
if (task.isSuccessful())
{
Intent i = new Intent(login.this, MainActivity.class);
i.putExtra("Email",Email);
startActivity(i);
finish();
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "" + task.getException(), Toast.LENGTH_SHORT).show();
}
}
});
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "Password Must be 8 Character Long", Toast.LENGTH_SHORT).show();
}
}
else
{
progressBar.setVisibility(View.INVISIBLE);
Toast.makeText(login.this, "Provide Email and Password", Toast.LENGTH_SHORT).show();
}
}
});
build.Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.butt************"
minSdkVersion 19
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 'com.google.firebase:firebase-database:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
testImplementation 'junit:junit:4.12'
compile 'com.google.firebase:firebase-auth:11.8.0'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:gridlayout-v7:27.0.1'
apply plugin: 'com.google.gms.google-services'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
}
apply plugin: 'com.google.gms.google-services'
With the Error Message:
W/BiChannelGoogleApi: [FirebaseAuth: ] getGoogleApiForMethod()
returned Gms
D/ViewRootImpl: Buffer Count from app info with ::-1 && -1 for ::
com.butt.mediacalradar from View :: -1 DBQ Enabled ::false false
"com.google.firebase.FirebaseException. An internal Error Occur [Bad Request]".
After Updating
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com**********"
minSdkVersion 19
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 'com.google.firebase:firebase-database:11.8.0'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:27.0.1'
implementation 'com.android.support:recyclerview-v7:27.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
compile 'com.google.firebase:firebase-auth:16.0.1'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:design:27.0.1'
implementation 'com.android.support:cardview-v7:27.0.1'
implementation 'com.android.support:gridlayout-v7:27.0.1'
apply plugin: 'com.google.gms.google-services'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
}
apply plugin: 'com.google.gms.google-services'
In order to make it work, please use the last versions for all your dependencies:
First change google services version (build.gradle Project) to:
classpath 'com.google.gms:google-services:4.0.1'
And the dependencies from:
compile 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
to
//compile 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
As you can see, the first line is commented. Don't also forget to delete the duplicate apply plugin: 'com.google.gms.google-services'. Should remain only at the end of the file.
Related
Could you help me to eliminate that DSL alert since as a result of this it does not allow me to link with firebase, I already tried the other groups and it does not work for me or maybe I do not know where to accommodate it
example
android {
buildFeatures {
dataBinding = true
// for view binding:
// viewBinding = true
}
}
I'm going crazy I don't know how to fix it
this is mi gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.app.womba"
minSdkVersion 27
targetSdkVersion 29
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
dataBinding {
enabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
android {
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.9.1"
// Multidex
implementation 'androidx.multidex:multidex:2.0.1'
// View Model
implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
annotationProcessor 'androidx.lifecycle:lifecycle-compiler:2.1.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
//initUI
implementation 'com.intuit.sdp:sdp-android:1.0.6'
implementation 'com.intuit.ssp:ssp-android:1.0.6'
/// glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
/// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.6.0'
/// okhttp3
implementation 'com.squareup.okhttp3:logging-interceptor:4.4.0'
/// CountryCodePicker
implementation 'com.github.inpossoft:CountryCodePickerProject:2.0.0'
//image picker
implementation 'com.github.maayyaannkk:ImagePicker:1.0.4'
implementation 'com.soundcloud.android:android-crop:1.0.1#aar'
// facebook
implementation 'com.facebook.android:facebook-login:5.12.1'
//validations
implementation "com.wajahatkarim3.easyvalidation:easyvalidation-core:1.0.1"
// crashlytics
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-core:17.2.1'
// push notification
implementation 'com.google.firebase:firebase-messaging:20.1.0'
// app permission
implementation 'com.afollestad:assent:2.3.1'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
implementation 'com.nex3z:flow-layout:1.3.0'
// Room
implementation 'androidx.room:room-runtime:2.2.3'
annotationProcessor 'androidx.room:room-compiler:2.2.3'
kapt 'androidx.room:room-compiler:2.2.3'
// socket
// implementation('io.socket:socket.io-client:0.8.3') {
// exclude group: 'org.json', module: 'json'
// }
implementation 'com.github.nkzawa:socket.io-client:0.6.0'
// double handel seekbar
implementation 'com.crystal:crystalrangeseekbar:1.1.3'
implementation 'com.wang.avi:library:2.1.3'
implementation('com.github.ganfra:material-spinner:2.0.0') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
//This is binah.ai sdk dependency
implementation project(path: ':bnhhrlib')
implementation 'com.jjoe64:graphview:4.2.2'
implementation files('libs/vidyoclient.jar')
implementation 'com.applandeo:material-calendar-view:1.4.0'
/**Stripe Payment Gateway*/
implementation 'com.stripe:stripe-android:12.1.0'
implementation 'com.karumi:dexter:4.2.0'
implementation 'io.github.luizgrp.sectionedrecyclerviewadapter:sectionedrecyclerviewadapter:3.1.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
// app permission
implementation 'com.afollestad:assent:2.3.1'
}
apply plugin: 'com.google.gms.google-services'
In advance thanks for the help
You'll have to replace
dataBinding {
enabled = true
}
with the recommended process
buildFeatures {
dataBinding = true
}
When app deploy on play store its getting crashes with this error. Many times reported this error on crashlytics. How I can resolve I am using kotlin for our application.Also integrated firebse analytics for tracking each screen of the app and its performance.
My build.gradle
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'io.fabric'
android {
signingConfigs {
config {
storeFile file('D:\\Android Production\\Key Store\\keyTool\\allindiaitr.jks')
storePassword '12345678'
keyAlias = 'asasasasas'
keyPassword '12345678'
}
}
compileSdkVersion 28
defaultConfig {
vectorDrawables.useSupportLibrary = true
applicationId "dell.com.allindiaitr"
minSdkVersion 19
targetSdkVersion 28
versionCode 61
versionName "7.9"
multiDexEnabled true
resConfigs "en", "US"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
signingConfig signingConfigs.config
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
// lintOptions {
// checkReleaseBuilds false
// // Or, if you prefer, you can continue to check for errors in release builds,
// // but continue the build even when errors are found:
// abortOnError false
// }
}
//configurations.all {
// resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// def requested = details.requested
// if (requested.group == "com.android.support") {
// if (!requested.name.startsWith("multidex")) {
// details.useVersion "26.+"
// }
// }
// }
//}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
// implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.google.firebase:firebase-core:10.2.1'
// (Recommended) Add Analytics
// implementation 'com.google.firebase:firebase-analytics:17.2.0'
// Add dependency
// implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
// implementation 'com.android.support:support-v4:28.0.0'
implementation('com.paytm:pgplussdk:1.3.3') {
transitive = true;
}
implementation 'androidx.appcompat:appcompat:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.0.0'
implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
// implementation 'com.squareup.retrofit2:converter-gson:2.6.2'
// implementation 'com.squareup.okhttp3:logging-interceptor:4.2.2'
// implementation 'com.squareup.okhttp3:okhttp:4.2.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'com.github.bumptech.glide:glide:4.4.0'
implementation 'com.itextpdf:itextg:5.5.10'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-auth-api-phone:16.0.0'
kapt 'com.github.bumptech.glide:compiler:4.9.0'
kapt "android.arch.lifecycle:compiler:1.0.0"
implementation 'com.getkeepsafe.taptargetview:taptargetview:1.11.0'
implementation 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
implementation project(':filepicker')
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
implementation 'com.facebook.android:facebook-android-sdk:[5,6)'
implementation 'com.facebook.android:facebook-android-sdk:5.11.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
//SMS User Consent API
implementation "com.google.android.gms:play-services-auth:17.0.0"
implementation "com.google.android.gms:play-services-auth-api-phone:17.1.0"
}
apply plugin: 'com.google.gms.google-services'
I tried to build my android project ( react-native ) and it gives me this error
Failed to resolve: com
And when i click on open the file, it show a line in app build.gradle
apply plugin: "com.android.application"
This is my app gradle file
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: "com.android.application"
apply plugin: 'io.fabric'
//apply plugin: 'com.neenbedankt.android-apt'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
flavorDimensions "default"
defaultConfig {
applicationId "[APPLICATINO ID]"
targetSdkVersion 26
versionCode 8
versionName '1.0.5'
ndk {
abiFilters 'armeabi-v7a', 'x86'
}
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
// Deprecated. Used by net.openid:appauth
manifestPlaceholders = [
'appAuthRedirectScheme': 'host.exp.exponent'
]
}
dexOptions {
javaMaxHeapSize System.getenv("DISABLE_DEX_MAX_HEAP") ? null : "8g"
}
productFlavors {
// Define separate dev and prod product flavors.
dev {
// dev utilizes minSDKVersion = 21 to allow the Android gradle plugin
// to pre-dex each module and produce an APK that can be tested on
// Android Lollipop without time consuming dex merging processes.
minSdkVersion 21
}
devRemoteKernel {
minSdkVersion 21
}
dev19 {
// For debugging / development on older SDK versions. Increases build
// time so use 'dev' if not running on older SDKs.
minSdkVersion 19
}
prod {
// The actual minSdkVersion for the application.
minSdkVersion 19
}
}
buildTypes {
debug {
debuggable true
}
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
zipAlignEnabled true
}
}
signingConfigs {
debug {
storeFile file('../debug.keystore')
}
}
lintOptions {
abortOnError false
}
packagingOptions {
pickFirst "**"
}
}
// Don't use modern jsc-android since it still has some critical bugs that
// crash applications when the string for the JS bundle is loaded and when
// locale-specific date functions are called.
// configurations.all {
// resolutionStrategy {
// force 'org.webkit:android-jsc:r216113'
// }
// }
apply from: 'expo.gradle'
dependencies {
// This should be here already
implementation project(':react-native-firebase')
// Firebase dependencies
implementation "com.google.android.gms:play-services-base:15.0.1"
implementation "com.google.firebase:firebase-core:16.0.1"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.1'
// Our dependencies
implementation 'com.android.support:appcompat-v7:27.1.1'
// Our dependencies from ExpoView
// DON'T ADD ANYTHING HERE THAT ISN'T IN EXPOVIEW. ONLY COPY THINGS FROM EXPOVIEW TO HERE.
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.facebook.android:facebook-android-sdk:4.7.0'
implementation('com.facebook.android:audience-network-sdk:4.22.1') {
exclude module: 'play-services-ads'
}
compileOnly 'org.glassfish:javax.annotation:3.1.1'
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'de.greenrobot:eventbus:2.4.0'
implementation 'com.amplitude:android-sdk:2.9.2' // Be careful when upgrading! Upgrading might break experience scoping. Check with Jesse. See Analytics.resetAmplitudeDatabaseHelper
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-gcm:12.0.1'
implementation 'com.google.android.gms:play-services-analytics:12.0.1'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-auth:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.google.android.gms:play-services-ads:12.0.1'
annotationProcessor 'com.raizlabs.android:DBFlow-Compiler:2.2.1'
implementation "com.raizlabs.android:DBFlow-Core:2.2.1"
implementation "com.raizlabs.android:DBFlow:2.2.1"
implementation "com.madgag.spongycastle:core:1.53.0.0"
implementation "com.madgag.spongycastle:prov:1.53.0.0"
debugImplementation 'com.s quareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
// debugCompile 'com.squareup.leakcanary:leakcanary-android:1.4-beta1'
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.4-beta1'
implementation 'com.facebook.device.yearclass:yearclass:1.0.1'
implementation 'commons-io:commons-io:1.3.2'
implementation 'me.leolin:ShortcutBadger:1.1.4#aar'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.4.7'
implementation 'com.yqritc:android-scalablevideoview:1.0.1'
implementation 'commons-codec:commons-codec:1.10'
implementation 'com.segment.analytics.android:analytics:4.3.0'
implementation 'com.google.zxing:core:3.2.1'
implementation 'net.openid:appauth:0.4.1'
implementation('com.airbnb.android:lottie:2.5.5') {
exclude group: 'com.android.support', module: 'appcompat-v7'
}
implementation 'io.branch.sdk.android:library:2.17.1'
implementation('io.nlopez.smartlocation:library:3.2.11') {
transitive = false
}
implementation 'com.android.support:exifinterface:27.1.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.okhttp3:okhttp-urlconnection:3.4.1'
implementation 'com.squareup.okhttp3:okhttp-ws:3.4.1'
implementation 'com.squareup.okio:okio:1.9.0'
// Testing
// androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.1'
// We use a modified build of com.android.support.test:runner:1.0.1. Explanation in maven-test/README
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support:support-annotations:27.1.1'
androidTestImplementation 'com.google.code.findbugs:jsr305:3.0.0'
androidTestImplementation 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
androidTestImplementation 'com.azimolabs.conditionwatcher:conditionwatcher:0.2'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'org.robolectric:robolectric:3.8'
implementation('host.exp.exponent:expoview:28.0.0#aar') {
transitive = true
}
}
// This has to be down here for some reason
apply plugin: 'com.google.gms.google-services'
And here is my logcat result: https://justpaste.it/60b4o
Try setting http proxy in setting. the fabric library is restricted in some countries like Iran
I am trying to save a location to geofire but not getting any response from console and in logs.
I have added the dependency in gradle files and created my database reference like this:
DatabaseReference pickupRef = FirebaseDatabase.getInstance().getReference(AppConstants.PICK_UP_REF);
pickupRef.keepSynced(true);
and the string AppConstants.PICK_UP_REF equals PickUpRef. In my activity, I have done this:
Log.d(TAG, "UID in PUR:\t" + uid);
GeoFire mGeoFire = new GeoFire(pickupRef.child(uid));
if (mLastLocation != null) {
mGeoFire.setLocation(uid, new GeoLocation(mLastLocation.getLatitude(), mLastLocation.getLongitude()), new GeoFire.CompletionListener() {
#Override
public void onComplete(String key, DatabaseError error) {
if (error != null){
Log.d(TAG, "Write complete");
} else {
Log.d(TAG, "Write Failed:\t" + error.getMessage());
}
}
});
The oncompletionlistener never gets fired and nothing is updated in my database. Anyone else faced this problem or have I misconfigured it?
Here's my gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.jjoey.transportr"
minSdkVersion 17
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:12.0.1'
implementation 'com.google.firebase:firebase-auth:12.0.1'
implementation 'com.google.firebase:firebase-database:12.0.1'
implementation 'com.google.firebase:firebase-storage:12.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:12.0.1'
implementation 'com.google.android.gms:play-services-maps:12.0.1'
implementation 'com.google.android.gms:play-services-places:12.0.1'
implementation 'com.google.android.gms:play-services-location:12.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Change your dependencies like below in app grandle:
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.reginald:editspinner:1.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebase:geofire-android:2.3.1'
implementation 'com.google.android.gms:play-services-nearby:15.0.1'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-places:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.afollestad.material-dialogs:core:0.9.6.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
}
And change in Project grandle:
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
I'm trying to create a signed APK, but an error will appear at the end:
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/design/widget/CoordinatorLayout$1.class
apply plugin: 'com.android.application'
apply plugin: 'com.jakewharton.butterknife'
buildscript {
repositories {
maven { url "https://github.com/omadahealth/omada-nexus/raw/master/release" }
maven { url "https://jitpack.io" }
}
dependencies {
}
}
android {
signingConfigs {
config {
}
}
lintOptions {
abortOnError false
}
dataBinding {
enabled = true
}
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.myandroidapp.android"
minSdkVersion 17
targetSdkVersion 27
versionCode 5
versionName "1.3"
multiDexEnabled true
}
buildTypes {
release {
ext.enableCrashlytics = true
//shrinkResources false
//minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
//debuggable false
//jniDebuggable false
signingConfig signingConfigs.config
//zipAlignEnabled true
}
debug {
//debuggable true
ext.enableCrashlytics = true
//minifyEnabled false
//shrinkResources false
//renderscriptDebuggable false
//jniDebuggable false
proguardFiles 'proguard-rules.txt'
//signingConfig signingConfigs.debug
}
}
packagingOptions {
exclude 'META-INF/services/javax.annotation.processing.Processor'
exclude 'META-INF/**'
exclude 'META-INF/**'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
jcenter()
}
android {
dexOptions {
jumboMode = true
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// Navigation Drawer Library
compile('com.mikepenz:materialdrawer:5.3.0#aar') {
transitive = true
}
//Google, Inc (Play services) Libraries
implementation 'com.google.android.gms:play-services-places:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services-location:11.8.0'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-crash:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-config:11.8.0'
implementation 'com.google.firebase:firebase-appindexing:11.8.0'
implementation 'com.google.android.gms:play-services-appinvite:11.8.0'
//Google, Inc (Firebase) Libraries
implementation 'com.firebase:firebase-jobdispatcher:0.6.0'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.firebase:geofire-android:2.1.2'
// Google, Inc (Support) Libraries
implementation 'com.android.support:support-v13:27.0.2'
//implementation 'com.android.support:customtabs:27.0.2'
implementation 'com.android.support:cardview-v7:27.0.2'
implementation 'com.android.support:support-v4:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:multidex:1.0.2'
implementation 'com.android.support:palette-v7:27.0.2'
implementation 'com.android.support:support-vector-drawable:27.0.2'
//implementation 'com.android.support.constraint:constraint-layout:1.0.2'
// Facebook, Inc SDKs
implementation 'com.facebook.android:facebook-android-sdk:4.29.0'
// Libraries for images
implementation 'de.hdodenhof:circleimageview:2.1.0'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.lorentzos.swipecards:library:1.0.9'
implementation 'com.skyfishjy.ripplebackground:library:1.0.1'
implementation 'com.vanniktech:emoji-twitter:0.5.1'
implementation 'com.theartofdev.edmodo:android-image-cropper:2.6.0'
implementation 'com.github.yalantis:ucrop:2.2.1'
implementation 'com.github.jkwiecien:EasyImage:1.3.1'
implementation 'jp.wasabeef:picasso-transformations:2.1.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
// Location Helper Library
implementation 'com.squareup.retrofit2:retrofit:2.2.0'
implementation 'com.squareup.retrofit:converter-gson:2.0.0-beta1'
// Time library
implementation 'joda-time:joda-time:2.9.9'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
// Others
// event bus
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.flipboard:bottomsheet-core:1.5.3'
implementation 'com.flipboard:bottomsheet-commons:1.5.3'
implementation 'com.greysonparrelli.permiso:permiso:0.3.0'
implementation 'com.googlecode.libphonenumber:libphonenumber:8.5.2'
implementation 'com.airbnb.android:lottie:2.2.5'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'com.google.gms.google-services'
This may be due to different versions of the support library being used.
Add the following in your build.gradle
configurations.all {
resolutionStrategy {
force 'com.android.support:design:27.0.2'
force 'com.android.support:support-v4:27.0.2'
force 'com.android.support:appcompat-v7:27.0.2'
}
}