Firebase file not found exception

I am using a Firebase database in a Rideshare application and I am trying to upload the code on the device and it shows me. The file did not find an exception in which Jackson data binding library files are not integrated during build. I need to clean it and gradle run it like 10 or 15 times and then install it once. I am converting a snapshot of Firebase data into my custom Java objects in my code, and the Jackson library files disappear, and ultimately the mapping fails. I tried to remove the obsolete Api too, only to see how it crashed again. Some are helping me.

Here is the error I get all the time:

Error: Failed to capture snapshot of output files for task 'transformClassesWithDexForDebug' during validation.

java.io.FileNotFoundException: D: \ FirebaseDBTesting \ app \ build \ intermediates \ transforms \ dex \ debug \ folders \ 1000 \ 10 \ jackson-databind-2.2.2_502dac698d8ab87b5c73024fb2c1baa4c979a770 \ classes.dex (the system cannot find

here is my gradle file:

apply plugin: 'com.android.application' android { packagingOptions { exclude 'META-INF/DEPENDENCIES.txt' exclude 'META-INF/DEPENDENCIES' exclude 'META-INF/dependencies.txt' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/LICENSE' exclude 'META-INF/license.txt' exclude 'META-INF/LGPL2.1' exclude 'META-INF/NOTICE.txt' exclude 'META-INF/NOTICE' exclude 'META-INF/notice.txt' } compileSdkVersion 23 buildToolsVersion "24.0.3" defaultConfig { applicationId "com.example.xinthe.firebasedbtesting" minSdkVersion 17 targetSdkVersion 23 versionCode 1 versionName "1.0" multiDexEnabled true testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } dexOptions { javaMaxHeapSize "4g" } 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:23.4.0' compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.firebase:geofire-android:2.1.1' compile 'com.google.firebase:firebase-crash:10.0.1' compile 'com.google.firebase:firebase-auth:10.0.1' compile 'com.firebase:firebase-client-android:2.5.2' compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:design:23.4.0' compile 'com.google.android.gms:play-services-maps:10.0.1' compile 'com.google.android.gms:play-services-location:10.0.1' compile 'com.android.support:support-v4:23.4.0' compile 'com.serhatsurguvec.libraries:continuablecirclecountdownview:1.2' testCompile 'junit:junit:4.12' } apply plugin: 'com.google.gms.google-services' 
+7
android build.gradle firebase geofire
source share
3 answers

First try to clean and rebuild the project.

Then open File β†’ Invalidate Caches / Restart, click on the blue button Invalidate Caches / Restart.

0
source share

See if these changes help:

 compileSdkVersion 25 buildToolsVersion "25.0.3" dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.3.1' // <= CHANGE compile 'com.google.firebase:firebase-database:10.0.1' compile 'com.firebase:geofire-android:2.1.1' compile 'com.google.firebase:firebase-crash:10.0.1' compile 'com.google.firebase:firebase-auth:10.0.1' compile 'com.firebase:firebase-client-android:2.5.2' // <= Why using legacy SDK?? compile 'com.android.support:multidex:1.0.1' compile 'com.android.support:design:25.3.1' // <= CHANGE compile 'com.google.android.gms:play-services-maps:10.0.1' compile 'com.google.android.gms:play-services-location:10.0.1' compile 'com.android.support:support-v4:25.3.1' // <= CHANGE compile 'com.serhatsurguvec.libraries:continuablecirclecountdownview:1.2' testCompile 'junit:junit:4.12' } 

And as I already noted in my comment, you are building both the SDK and the SDK 10.xx This is usually not necessary and can cause problems. Is there anything in the legacy SDK that you think is not available in the 10.xx SDK?

0
source share

TL; DR

As @ bob-snyder mentioned, why are you using both obsolete and latest APIs? Do you transfer application code?

Clean gradle build

Several times we process the Gradle construct, so to make the dependencies of the update assembly fewer errors and errors, we better structure the configuration files.

Jackson and Firebase 3

Jackson dependencies were part of the original Firebase, not Firebase 3. If you are moving the application from 2 to 3, I would advise you to transfer your data objects to Google Gson .

Enable minify

You do not use so many libraries that you must be forced to use multidex . There are good examples on Firebase-UI Android and Android Blueprints on how to set up a ProGuard file.

Support Library Version

Define your library version in the root file of the build.gradle project, as shown in Google Samples :

 ext { // SDK and tools minSdkVersion = 10 targetSdkVersion = 25 compileSdkVersion = 25 buildToolsVersion = '25.0.0' // App dependencies firebaseVersion = '11.0.2' guavaVersion = '18.0' googleServicesVersion = rootProject.firebaseVersion supportLibraryVersion = '25.3.1' } 

And use the rootProject values ​​in the build.gradle project:

 dependencies { compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion" compile "com.android.support:design:$rootProject.supportLibraryVersion" compile "com.android.support:support-v4:$rootProject.supportLibraryVersion" // Legacy Firebase compile "com.firebase:firebase-client-android:2.5.2" compile "com.firebase:geofire-android:2.1.1" // Google Services compile "com.google.android.gms:play-services-location:$rootProject.googleServicesVersion" compile "com.google.android.gms:play-services-maps:$rootProject.googleServicesVersion" // Google Firebase compile "com.google.firebase:firebase-auth:$rootProject.firebaseVersion" compile "com.google.firebase:firebase-crash:$rootProject.firebaseVersion" compile "com.google.firebase:firebase-database:$rootProject.firebaseVersion" compile 'com.serhatsurguvec.libraries:continuablecirclecountdownview:1.2' } 
0
source share

All Articles