The signed apk of my app runs on the android versions higher than 5.0.1 but I am facing this issue that my app crashes immediately after launching the app on version 5.0.1 and this is the error I get -
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.v4.util.ArrayMap" on path: DexPathList[[zip file "/data/app/com.*****1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
please note that the app is not crashing when I run using android studio but it crashes when I run the signed apk.
I don't know what to do, I have gone through a lot of stackoverflow questions but found nothing that can solve my issue. This is my app.gradle file -
**buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' } // for crashlytics
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "*****"
minSdkVersion 21
targetSdkVersion 26
flavorDimensions "default"
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
versionCode 3
multiDexEnabled true
versionName "1.0.3"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android {
lintOptions {
checkReleaseBuilds false
abortOnError false
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
dexOptions {
javaMaxHeapSize "2g"
}
}
repositories {
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//google 's library
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.0.2'
implementation 'com.android.support:design:26.0.2'
implementation 'com.android.support:support-v4:26.0.2'
implementation 'com.android.support:support-v13:26.0.2'
implementation 'com.android.support:cardview-v7:26.0.2'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.google.android.gms:play-services-vision:11.8.0'
//for barcode generation
implementation 'com.google.zxing:core:3.2.0'
implementation 'com.android.support:multidex:1.0.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
compile 'me.dm7.barcodescanner:zxing:1.9'
compile 'com.journeyapps:zxing-android-embedded:3.0.2#aar'
//multidex support
compile 'com.android.support:multidex:1.0.1'
//for fancy dialogs
implementation 'com.google.android.gms:play-services-maps:11.8.0'
implementation 'com.google.android.gms:play-services:11.8.0'
compile 'com.geniusforapp.fancydialog:FancyDialog:0.1.4'
//for home screen carousal view
compile 'com.synnapps:carouselview:0.1.4'
//for bottom navigation
compile 'com.ss.bottomnavigation:bottomnavigation:1.5.2'
//for shaping the image view
compile 'com.github.siyamed:android-shape-imageview:0.9.+#aar'
compile 'com.jackandphantom.android:circularimageview:1.2.0'
//libraries for retrofit and conversion factory GSON
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.google.code.gson:gson:2.8.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
//FilePicker Library
compile 'com.droidninja:filepicker:2.0.8'
//for welcome screen
compile 'com.stephentuso:welcome:1.4.1'
compile 'com.squareup.okhttp3:okhttp:3.9.1'
compile 'com.squareup.okhttp3:okhttp-urlconnection:3.0.1'
compile 'com.squareup.retrofit2:converter-scalars:2.3.0'
compile 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
compile 'com.squareup.okhttp3:okhttp:3.3.1'
//material calender picker
compile 'com.wdullaer:materialdatetimepicker:3.4.0'
implementation 'com.trello:rxlifecycle:1.0'
implementation 'com.trello:rxlifecycle-components:1.0'
compile 'com.polidea.rxandroidble:rxandroidble:1.4.3'
implementation 'com.android.support:design:26.0.2'
compile 'io.reactivex.rxjava2:rxjava:2.0.7'
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
//libraries for firebase integration
//for analytics
compile 'com.google.firebase:firebase-core:11.8.0'
//for cloud messenging
compile 'com.google.firebase:firebase-messaging:11.8.0'
//for circular indicator
compile 'com.github.lzyzsd:circleprogress:1.2.1'
compile 'me.biubiubiu.justifytext:library:1.1'
implementation files('libs/imagecapture.jar')
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
}
apply plugin: 'com.google.gms.google-services'**
This is my build.gradle (project level)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.0'
classpath 'io.fabric.tools:gradle:1.25.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If the gradle version is 3.x.x try to add maven { url 'https://maven.google.com' } to
allprojects {
repositories {
//add here
}
}
instead of google() and sync gradle. It should help. You can see difference between them using this link.
I found the solution. I tried building the Signed apk for both the signature versions V1(jar signature) and V2(full apk signature) and it worked.
Related
I am getting the error Failed to resolve: support-v4 I've tried loads of solutions online but none work. This started happening after I migrated to androidX and after I updated Android Studio.
I've tried changing version around. Im not quite sure if there is any conflicting library's or if that is even an problem. Please help , I'm really struggling.
Thank you in advance
Here are my gradle files;
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
google()
}
dependencies {
classpath 'io.fabric.tools:gradle:1.25.4'
}
}
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.7.0'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
android {
compileSdkVersion setup.compileSdk
buildToolsVersion '28.0.2'
defaultConfig {
applicationId "com.virtualflight.VirtualHub"
minSdkVersion setup.minSdk
targetSdkVersion setup.targerSdk
versionCode 39
versionName "3.5.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
android {
defaultConfig.applicationId="com.virtualflight.VirtualHub"
defaultConfig {
manifestPlaceholders = [onesignal_app_id: "977e8aef-4b31-4d36-91e4-2555572b9efe",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "REMOTE"]
}
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
customDebugType {
debuggable true
}
}
productFlavors {
}
}
repositories {
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//Google dependencies bellow
compile "com.android.support:support-compat:28.0.0"
compile 'com.android.support.constraint:constraint-layout:1.1.3'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:design:28.0.0'
compile 'com.android.support:cardview-v7:28.0.0'
compile 'com.android.support:appcompat-v7:28.0.0'
compile 'com.android.support:recyclerview-v7:28.0.0'
compile 'com.thefinestartist:finestwebview:1.2.7'
compile 'com.github.barteksc:android-pdf-viewer:2.8.2'
compile 'com.github.medyo:fancybuttons:1.8.4'
compile 'com.intuit.sdp:sdp-android:1.0.4'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.sothree.slidinguppanel:library:3.4.0'
//MultiDex
compile 'com.google.code.gson:gson:2.8.2'
compile 'com.squareup.retrofit2:retrofit:2.2.0'
compile 'com.squareup.retrofit2:converter-gson:2.2.0'
//Ads
compile 'com.google.android.gms:play-services-ads:11.6.0'
//Firebase Below
compile 'com.google.firebase:firebase-core:11.6.0'
testCompile 'junit:junit:4.12'
//Material search bar
compile 'com.github.mancj:MaterialSearchBar:0.7'
//Mapbox dependencies bellow
compile('com.mapbox.mapboxsdk:mapbox-android-sdk:5.0.2#aar') {
transitive = true
}
compile ('com.thoughtworks.xstream:xstream:1.4.7') {
exclude group: 'xmlpull', module: 'xmlpull'
}
compile 'com.onesignal:OneSignal:3.6.5'
compile 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-java-core:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-java-services:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-java-services-rx:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-android-services:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-android-telemetry:2.1.0'
compile 'com.mapbox.mapboxsdk:mapbox-android-ui:2.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
compile files('libs/volley.jar')
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
implementation "com.android.support:support-core-utils:28.0.0"
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.51'
ext {
setup = [
compileSdk: 28,
buildTools: "26.0.2",
minSdk:19,
targetSdk:28
]
versions = [
supportLib:"27.0.2"
]
}
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Update:
I have also tried Clearing the project. When I do so the following error comes up.
Could not find support-v4.aar (androidx.legacy:legacy-support-v4:1.0.0).Searched in the following locations:
https://dl.google.com/dl/android/maven2/androidx/legacy/legacy-support-v4/1.0.0/support-v4-1.0.0.aar
you might be missing a dependency:
dependencies {
api "androidx.legacy:legacy-support-v4:1.0.0"
}
Firebase and Google Services are also rather outdated versions... with androidx you should get rid of versions = [supportLib:"27.0.2"] and those 28.0.0 versions. as a migration example:
dependencies {
// compile "com.android.support:support-compat:28.0.0"
api "androidx.core:core:1.0.0"
// compile 'com.android.support:appcompat-v7:28.0.0'
api "androidx.appcompat:appcompat:1.0.0"
// compile 'com.android.support:recyclerview-v7:28.0.0'
api "androidx.recyclerview:recyclerview:1.0.0"
// compile 'com.android.support:cardview-v7:28.0.0'
api "androidx.cardview:cardview:1.0.0"
// compile 'com.android.support:design:28.0.0'
api "com.google.android.material:material:1.0.0-rc01"
// compile 'com.android.support.constraint:constraint-layout:1.1.3'
api "androidx.constraintlayout:constraintlayout-solver:1.1.2"
api "androidx.constraintlayout:constraintlayout:1.1.2"
// compile 'com.google.android.gms:play-services-ads:11.6.0'
api "com.google.android.gms:play-services-base:16.0.1"
api "com.google.android.gms:play-services-ads:16.0.0"
// compile 'com.google.firebase:firebase-core:11.6.0'
api "com.google.firebase:firebase-core:16.0.4"
// androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestImplementation "com.android.support.test.espresso:espresso-core:3.0.2"
...
}
see the package mapping.
I am getting these errors while building the project
Failed to resolve: firebase-core
Failed to resolve: multidex
Failed to resolve: play-services-ads
Failed to resolve: play-services-auth
Failed to resolve: firebase-auth-license
Failed to resolve: common
Please check and let me know how this issue can be resolved?
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin' version '0.8.1'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "com.test.android"
minSdkVersion 15
targetSdkVersion 26
versionCode 3
versionName "1.0.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
multiDexEnabled true
manifestPlaceholders = [onesignal_app_id : "65f11821-8462-4ec4-9e41-XXXXXXXX",
// Project number pulled from dashboard, local value is ignored.
onesignal_google_project_number: "91629XXXXX00"]
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
// applovin
implementation project(':unity-ads')
//unity ads
//compile 'com.google.android.gms:play-services-ads:11.0.4'
implementation 'com.android.support:appcompat-v7:26.+'
implementation 'com.android.support:design:26.+'
implementation 'com.android.support:support-vector-drawable:26.+'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.+'
implementation 'com.google.android.gms:play-services:11.6.0'
implementation 'com.android.support:multidex:1.0.1'
//compile 'com.github.cooltechworks:ScratchView:v1.1'//not used
implementation 'com.jackpocket:scratchoff:1.1.0'
implementation 'com.adcolony:sdk:3.2.1'
implementation 'com.android.support:support-annotations:26.0.1'
implementation 'com.google.android.gms:play-services-ads:11.6.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.facebook.android:facebook-share:[4,5)'
testImplementation 'junit:junit:4.12'
implementation 'com.ironsource.sdk:mediationsdk:6.7.0.1#jar'
//compile 'com.google.ads.mediation:unity:2.1.1.0' //not used
implementation 'com.google.firebase:firebase-database:11.6.0'
implementation 'com.github.bumptech.glide:glide:4.1.1'
implementation 'commons-net:commons-net:3.3'
//get server time
//compile 'com.github.instacart.truetime-android:library-extension-rx:2.0'
//compile 'com.github.instacart.truetime-android:library:2.0' // not used
implementation 'com.google.firebase:firebase-auth:11.6.0'
implementation 'com.google.firebase:firebase-core:11.6.0'
implementation 'com.google.android.gms:play-services-auth:11.6.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.onesignal:OneSignal:[3.7.1, 3.99.99]'
implementation files('libs/applovin-sdk-7.7.0-javadoc.jar')
implementation files('libs/applovin-sdk-7.7.0.jar')
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
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" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Apparently, jcenter has started mirroring Google's repo. Try moving google() before jcenter() in the allprojects section of your project's build.gradle (like this):
repositories {
google()
jcenter()
maven { url "https://maven.google.com" }
maven { url "https://jitpack.io" }
maven { url "https://adcolony.bintray.com/AdColony" }
maven { url "https://dl.bintray.com/ironsource-mobile/android-sdk" }
}
Have you tried rebuilding the app? Also make sure you are using the latest version of GMS. As a sidenote you dont need to add the entire gms library, you can add selective services. I see you have added gms- and gms-ads, which would already be included in the main gms.
After updating the Target version P getting error
Error:Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.google.firebase:firebase-analytics:11.8.0.
Open FileShow Details
1.I added the google() in project gradle file
2.I have also checked by doing sync and clean project.
I checked below links
Unable to resolve all dependencies in android studio
Unable to resolve dependency Android Studio 3.0
1.App/Gradle
apply plugin: 'com.android.application'
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 'android-P'
defaultConfig {
applicationId 'com.ctdiindia.b2b'
minSdkVersion 15
targetSdkVersion 'P'
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'
}
debug {
debuggable true
}
}
buildToolsVersion '27.0.3'
productFlavors {
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
//Testing
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
testCompile 'org.mockito:mockito-all:1.10.19'
// Firebase
compile 'com.google.firebase:firebase-analytics:11.8.0'
compile 'com.google.firebase:firebase-database:11.8.0'
compile 'com.google.firebase:firebase-storage:11.8.0'
compile 'com.google.firebase:firebase-messaging:11.8.0'
compile 'com.google.firebase:firebase-core:11.8.0'
// Firebase UI
compile 'com.firebaseui:firebase-ui-database:3.1.0'
//Reycycler View
implementation 'com.android.support:recyclerview-v7:27.1.0'
implementation 'com.android.support:design:27.1.0'
implementation 'com.android.support:cardview-v7:27.1.0'
//Networking
implementation 'com.google.code.gson:gson:2.8.2'
compile 'com.amitshekhar.android:android-networking:1.0.1'
//Observabale librares
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.8'
}
apply plugin: 'com.google.gms.google-services'
2.Project/Gradle
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
}
Anyone had this similar issue?
Instead of:
compile 'com.google.firebase:firebase-analytics:11.8.0'
use:
implementation 'com.google.firebase:firebase-analytics:11.8.0'
Use this
com.google.firebase:firebase-core:11.8.0
Instead of this
compile 'com.google.firebase:firebase-analytics:11.8.0'
FROM DOCS : com.google.firebase:firebase-core is a recommended alias for the com.google.firebase:firebase-analytics library.
The following libraries are available for the various Firebase features.
Gradle Dependency Line Service
com.google.firebase:firebase-core:11.8.0 Analytics
com.google.firebase:firebase-database:11.8.0 Realtime Database
com.google.firebase:firebase-firestore:11.8.0 Cloud Firestore
com.google.firebase:firebase-storage:11.8.0 Storage
com.google.firebase:firebase-crash:11.8.0 Crash Reporting
com.google.firebase:firebase-auth:11.8.0 Authentication
com.google.firebase:firebase-messaging:11.8.0 Cloud Messaging
com.google.firebase:firebase-config:11.8.0 Remote Config
com.google.firebase:firebase-invites:11.8.0 Invites and Dynamic Links
com.google.firebase:firebase-ads:11.8.0 AdMob
com.google.firebase:firebase-appindexing:11.8.0 App Indexing
com.google.firebase:firebase-perf:11.8.0 Performance Monitoring
Hello suddenly my android project shows this error
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Before some days everything worked fine and I just opened it again after some days and shows me this
I have tried all the possible solutions I found here but nothing worked can you help me on this?
Here is my byuild.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.fire.stmtfadmin"
minSdkVersion 17
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'
}
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.android.support:cardview-v7:+'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile 'id.zelory:compressor:2.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
compile 'com.yqritc:recyclerview-multiple-viewtypes-adapter:1.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.StevenDXC:DxLoadingButton:2.0'
compile 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56' // commit hash
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'br.com.simplepass:loading-button-android:1.12.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To use the 11.4.0 version of Firebase, you need to add maven url to your build.gradle file like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
This is probably because you're using the following dependencies:
compile 'com.android.support:cardview-v7:+'
where it means you want to use the latest version. The latest version 27.1.0.
Try using:
implementation 'com.android.support:cardview-v7:26.1.0'
And never use + for your dependency version. So you can reproduce and debug the same build if there is any problem in the future.
thank you all for your replies but the only solution that worked for me was to add this line to build.gradle(Module:app):
implementation 'android.arch.lifecycle:extensions:1.1.0'
i hope this will help the others
I always get this error in my android studio, and i dont have any idea about this, i've tried to find the solution on the Internet but i still cant find it.
This is my Gradle Image :
this is the Error Image :
In your project the errors comes like you have not add project level google classpath and not apply google plugin in app level gradle so,
Add in project level gradle
classpath 'com.google.gms:google-services:3.1.1'
Add in APP level gradle and google plugin
dependencies {
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.android.gms:play-services:11.6.0'
}
// ADD THIS AT THE BOTTOM
apply plugin: 'com.google.gms.google-services'
NOTE-: If you want to add more Google gradle for your requirements then add with same version.
For More https://firebase.google.com/docs/android/setup
https://developers.google.com/android/guides/setup
If you are using Google Services your Gradles should look something like this:
App level build.gradle should look like
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-crash'
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.xxxxxx"
minSdkVersion 15
targetSdkVersion 26
versionCode 11
versionName "1.10"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
signingConfig signingConfigs.config
resValue("string", "PORT_NUMBER", "8081")
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
debugCompile project(':debug-db')
compile project(':tracker')
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.android.support:cardview-v7:26.1.0'
compile 'com.android.support:multidex:1.0.2'
compile 'com.google.android.gms:play-services-location:11.6.0'
compile 'com.google.android.gms:play-services-places:11.6.0'
compile 'com.google.android.gms:play-services-maps:11.6.0'
/* compile 'com.google.android.gms:play-services:11.6.0'*/
compile 'com.google.firebase:firebase-core:11.6.0'
compile 'com.google.firebase:firebase-crash:11.6.0'
compile 'com.google.firebase:firebase-messaging:11.6.0'
compile 'com.mcxiaoke.volley:library:1.0.19'
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.squareup.retrofit2:converter-gson:2.3.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:recyclerview-v7:26.1.0'
testCompile 'junit:junit:4.12'
}
// Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
As you could see, no use for build, but it completely depends on your use /* compile 'com.google.android.gms:play-services:11.4.0'*/
And root level gradle.build is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.google.gms:google-services:3.1.1'
classpath 'com.google.firebase:firebase-plugins:1.1.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://jitpack.io" }
jcenter()
mavenCentral()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Make sure your Gradle distribution in gradle-wrapper.properties is
distributionUrl=https\://services.gradle.org/distributions/gradle-4.3-all.zip