Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase release apk not loading data

I am using firebase in my app, in debug apk everything works fine but when I change my build type to release and sign my apk and run the app data is not loaded am I doing anything wrong with rules?

Can't attach debugger to a release mode apk so not getting how to debug this.

Custom sign-in works fine, I am able to login with my registered email and password but data and images are not loading.

I logged in and then trying to show data, I think calls are authenticated

my database and storage rules

Storage Rule

service firebase.storage {
   match /b/example-frienda-backend.appspot.com/o {
    match /{allPaths=**} {
    allow read, write: if request.auth != null;
  }
 }
}

Datastore rules

{
  "rules": {
    ".read": "auth != null",
    ".write": "auth != null",
   "geofire": {
     ".indexOn": ["g"],
   }
  }
}
like image 562
Shivaraj Patil Avatar asked Jul 26 '16 10:07

Shivaraj Patil


3 Answers

The Proguard is creating problem in your case you need to check proguard rules make sure your all Pojo classes are listed in proguard.

Better option is places all your Pojo classes in a same package and add this

-keep class com.memes.trollfootball.data.db.model.** { *; }

into your proguard-rules.pro file.

like image 191
Nouman Ch Avatar answered Oct 20 '22 22:10

Nouman Ch


Please have a look at below link I have answered similar issue.

https://stackoverflow.com/a/59626147/5435517

Also in your case check you have added SHA properly to your fire base project, Firebase rules for your app.

like image 1
Deepak Rai Avatar answered Oct 20 '22 21:10

Deepak Rai


When building a release apk the signature "SHA-1" of the apk changes.So if you try to login in your app Using firebase-auth it will give you a toast like "f.f.d.o.d:10" and also it will not load data.

So you should do this:- Go to your firbase project and under "project-setting" goto "Your apps" and there just click on "add fingerprint" and then add your release apk fingerprint "SHA-1" and "SHA-256". If your data is still not loading or the app is crashing on fetching and setting data.Then in your build.gradle(:app) change this to : minifyEnabled false.Just look at the image for correction.

like image 1
Om kumar Yadav Avatar answered Oct 20 '22 22:10

Om kumar Yadav