-1

While running my app on my android phone through the android debugger my app runs properly. But as I build the apk file & install it on my phone it crashes while accessing data from firebase realtime database. I don't know what to do?

AL.
  • 36,815
  • 10
  • 142
  • 281

2 Answers2

0

Without any logs it's insane to give you a helpful answer, but mostly the reason for crashes is the internet permissions at the manifest or some forgotten activities. Also you need for Firebase read and write permission to the storage of the device.

malliaridis
  • 389
  • 1
  • 12
  • I have attached my comments please go through it: V/FA: Activity resumed, time: 238480646 I/Choreographer: Skipped 44 frames! The application may be doing too much work on its main thread. – – NILESH SINGH Jan 24 '17 at 11:00
  • Please check this post to edit your post with the useful log (http://stackoverflow.com/questions/14678593/the-application-may-be-doing-too-much-work-on-its-main-thread) – malliaridis Jan 24 '17 at 11:05
0

Try to do this :

Step 1:

First add this in your gradle

compile 'com.android.support:multidex:1.0.1'

Then

Create an Application Class , like MyApplication, then :

public class MyApplication extends Application{
    private Context c;

    @Override
    public void onCreate() {
        super.onCreate();



    }

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        MultiDex.install(this);
    }


}

Then finally go to your Manifest and do the following:

<application
        android:name="MyApplication"
        android:allowBackup="true"
        android:hardwareAccelerated="false"
        android:icon="@drawable/ic_icon"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
Lutaaya Huzaifah Idris
  • 3,596
  • 8
  • 38
  • 77