I am getting error of null in release build only. But when I am creating a release build it is getting crashed but working fine in debug mode.
When I was optimizing my apk i deleted mobile_navigation.xml file but it was never used anywhere
Here is my build file
//one signal integration
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.5'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
//end of one signal integration
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.codon.masterpiece"
minSdkVersion 17
targetSdkVersion 28
versionCode 110
versionName "4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
manifestPlaceholders = [
onesignal_app_id : 'a33a085c-d32d-4462-a850-334f5c73db01',
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: 'REMOTE'
]
}
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
}
buildTypes {
release {
minifyEnabled true
//shrinkResources true
//proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
res.srcDirs =
[
'src/main/res/layouts/home_and_fragments',
'src/main/res/layouts/login_and_onboarding',
'src/main/res/layouts',
'src/main/res'
]
}
}
buildToolsVersion '28.0.3'
compileOptions {
targetCompatibility = '1.8'
sourceCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.vectordrawable:vectordrawable:1.0.1'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'androidx.exifinterface:exifinterface:1.0.0'
//addedd libraries due to conflict
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.browser:browser:1.0.0'
//card view
implementation 'androidx.cardview:cardview:1.0.0'
//Facebook sdk
implementation 'com.facebook.android:facebook-android-sdk:5.2.0'
//Google login
implementation 'com.google.android.gms:play-services-auth:17.0.0'
//Play Store core library
implementation 'com.google.android.play:core:1.6.1'
//Recyclerview
implementation 'androidx.recyclerview:recyclerview:1.0.0'
//Retrofit
// implementation('com.squareup.retrofit2:retrofit:2.6.1') {
// // exclude Retrofit’s OkHttp dependency module and define your own module import
// exclude module: 'okhttp'
// }
implementation 'com.squareup.retrofit2:retrofit:2.6.1'
// exclude Retrofit’s OkHttp dependency module and define your own module import
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
// implementation 'com.squareup.okhttp3:logging-interceptor:4.1.1'
// implementation 'com.squareup.okhttp3:okhttp:4.1.1'
//Volley
implementation 'com.android.volley:volley:1.1.1'
//circle image view
implementation 'de.hdodenhof:circleimageview:2.2.0'
//image crop library
implementation 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
//Picasso
implementation 'com.squareup.picasso:picasso:2.71828'
//currency and country picker
//implementation 'com.github.midorikocak:currency-picker-android:1.1.9'
//implementation 'com.github.yesterselga:country-picker-android:1.0'
//country picker
implementation 'com.github.mukeshsolanki:country-picker-android:2.0.1'
//imageview zoom
implementation 'com.github.chrisbanes:PhotoView:2.0.0'
//one signal
implementation 'com.onesignal:OneSignal:3.11.2'
//google analytics
implementation 'com.google.android.gms:play-services-analytics:17.0.0'
//walkthrough
implementation 'com.github.amlcurran.showcaseview:library:5.4.3'
//progressbar
//implementation 'com.bigkoo:svprogresshud:1.0.6'
//facebook shimmer effect
implementation 'com.facebook.shimmer:shimmer:0.4.0'
//progress bar
implementation 'com.kaopiz:kprogresshud:1.2.0'
}
Here is my logcat
Process: com.codon.masterpiece, PID: 13865
java.lang.NullPointerException: throw with null exception
at com.codon.masterpiece.d.b.b.a(Unknown Source:3)
at com.codon.masterpiece.ui.home.e$d.a(:341)
at f.g$b$a$a.run(:83)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6746)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Please suggest me what might be wrong in the release mode
Add SerializedName in every field of models which are used in the serialization process by Gson.
import com.google.gson.annotations.SerializedName;
public class Example {
#SerializedName("fieldName")//Add this line for all fields, the name passed in SerializedName should be a key in json
private String fieldName;
public String getFieldName() {
return fieldName;
}
public void setFieldName(String fieldName) {
this.fieldName = fieldName;
}
}
Or
You can keep that model in progaurd rule
-keep class com.codon.masterpiece.model.Example { *; }//use the package name and class name for the models
Related
Azure Active Directory's library get "Failed to resolve: com.microsoft.device.display:display-mask:0.3.0" error.
Failed to resolve: com.microsoft.device.display:display-mask:0.3.0
build.gradle(Module:app):
dependencies {
//MSAL
implementation 'com.microsoft.identity.client:msal:4.0.5'
implementation 'com.microsoft.identity:common:8.0.3'
implementation 'com.microsoft.device.display:display-mask:0.3.0'
implementation 'com.microsoft.graph:microsoft-graph:5.40.0'
implementation 'com.azure:azure-identity:1.7.0-beta.2'
}
build.gradle(Project)
buildscript {
repositories {
google()
mavenCentral()
mavenLocal()
maven {
url 'https://pkgs.dev.azure.com/MicrosoftDeviceSDK/DuoSDK-Public/_packaging/Duo-SDK-Feed/maven/v1'
}
maven {
name "vsts-maven-adal-android"
url "https://identitydivision.pkgs.visualstudio.com/_packaging/AndroidADAL/maven/v1"
credentials {
username System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_USERNAME") : project.findProperty("vstsUsername")
password System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") != null ? System.getenv("ENV_VSTS_MVN_ANDROIDADAL_ACCESSTOKEN") : project.findProperty("vstsMavenAccessToken")
}
}
jcenter()
}
dependencies {
def nav_version = "2.5.2"
classpath "androidx.navigation:navigation-safe-args-gradle-plugin:$nav_version"
}
}
After I changed gradle.build(module:app) as follow,
everything works now.
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'dagger.hilt.android.plugin'
id 'com.google.dagger.hilt.android'
id 'androidx.navigation.safeargs.kotlin'
}
android {
namespace
compileSdk 33
defaultConfig {
applicationId
minSdk 26
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug{
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
packagingOptions {
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/AL2.0'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/io.netty.versions.properties'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.9.0'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.exifinterface:exifinterface:1.3.5'
implementation 'androidx.annotation:annotation:1.5.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
def lifecycle_version = "2.6.0-alpha03"
// ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version"
// LiveData
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycle_version"
// Lifecycles only (without ViewModel or LiveData)
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycle_version"
// Saved state module for ViewModel
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:$lifecycle_version"
// alternately - if using Java8, use the following instead of lifecycle-compiler
implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version"
//navigation
def nav_version = "2.5.3"
implementation "androidx.navigation:navigation-fragment-ktx:$nav_version"
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// CameraX core library using the camera2 implementation
def camerax_version = "1.2.0-rc01"
// The following line is optional, as the core library is included indirectly by camera-camera2
implementation "androidx.camera:camera-core:${camerax_version}"
implementation "androidx.camera:camera-camera2:${camerax_version}"
// If you want to additionally use the CameraX Lifecycle library
implementation "androidx.camera:camera-lifecycle:${camerax_version}"
// If you want to additionally use the CameraX View class
implementation "androidx.camera:camera-view:${camerax_version}"
// If you want to additionally use the CameraX Extensions library
implementation "androidx.camera:camera-extensions:${camerax_version}"
//dagger hilt
implementation 'com.google.dagger:hilt-android:2.44'
kapt 'com.google.dagger:hilt-compiler:2.44'
//Coroutine
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
//OKHttp3
implementation("com.squareup.okhttp3:okhttp:5.0.0-alpha.9")
implementation('com.squareup.okhttp3:logging-interceptor:5.0.0-alpha.9')
//Gson
implementation 'com.google.code.gson:gson:2.10'
//MSAL
implementation ("com.microsoft.identity.client:msal:4.0.5") { exclude group: 'com.microsoft.device.display'}
implementation 'com.microsoft.graph:microsoft-graph:5.40.0'
// Uncomment the line below if you are building an android application
implementation 'com.google.guava:guava:30.1.1-android'
// This dependency is only needed if you are using the TokenCrendentialAuthProvider
implementation 'com.azure:azure-identity:1.7.0-beta.2'
// To use CallbackToFutureAdapter
implementation "androidx.concurrent:concurrent-futures:1.1.0"
// Kotlin
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.6.4"
}
kapt {
correctErrorTypes true
}
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
}
I've implemented mapbox correctly before using android sdk 28 to compile, now mapbox crash only in release mode because I've minifyEnabled true. If I set it to false, doesn't crash.
The Exception is
Binary XML Error inflating com.mapbox.mapboxsdk.maps.MapView.
I use mapbox on fragment, and call
Mapbox.getInstance(getContext(), "TOKEN")
before inflating view in onCreateView method. Even after, same problem.
I think is a gradle problem, that is
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.31.0'
}
}
apply plugin: 'com.android.application'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
apply plugin: 'io.fabric'
android {
signingConfigs {
debug {
keyAlias 'ewhfpiqwufgqeifbqeifb'
keyPassword 'dbhedeiqlgdqoiefqwouf'
}
release {
}
}
compileSdkVersion 28
defaultConfig {
applicationId "widjpewoqhfqiwfhuw"
minSdkVersion 19
targetSdkVersion 27
versionCode 65
versionName "1.1.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled true
ext.enableCrashlytics = true
useProguard false
}
debug {
debuggable true
applicationIdSuffix ".debug"
minifyEnabled false
useProguard false
ext.enableCrashlytics = true
}
}
flavorDimensions "release", "debug"
productFlavors {
debugFlavor {
dimension "debug"
}
releaseFlavor {
dimension "release"
applicationIdSuffix ""
versionNameSuffix ""
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0'
androidTestImplementation ('androidx.test.espresso:espresso-core:3.1.0') {
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.google.zxing:core:3.3.0'
implementation 'com.google.android.gms:play-services-vision:18.0.0'
implementation 'com.baoyz.swipemenulistview:library:1.3.0'
implementation 'com.google.android.gms:play-services-location:17.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.5.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation ('com.mapbox.mapboxsdk:mapbox-android-sdk:7.3.0'){
transitive=true
}
implementation 'com.hbb20:ccp:2.2.2'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.volley:volley:1.1.0'
implementation ('com.crashlytics.sdk.android:crashlytics:2.10.1#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
Other info on crash:
Exception in onDidFinishLoadingStyle
java.lang.NullPointerException: throw with null exception
Abort message: 'terminating with uncaught exception of type
jni::PendingJavaException'
/data/app/mypkg-
qtZprFdEiYN4aOjj_lCtiA==/lib/arm64/libmapbox-gl.so
When you set minifyEnabled true, it will Enables code shrinking, obfuscation, and optimization which remove unused classes.
Use proguard to solve this:
https://github.com/mapbox/mapbox-android-demo/blob/master/MapboxAndroidDemo/proguard-rules.pro
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'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'
}
}