3

I have this issue only on Android 8.0 but I cannot understand why.

App crash after a few minutes in stand by.

My app has Location Permissions granted and my device has Bluetooth enabled (and BLE support)

This is the error:

java.lang.RuntimeException: at android.app.ActivityThread.handleReceiver (ActivityThread.java:3399) at android.app.ActivityThread.-wrap18 (Unknown Source) at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1780) at android.os.Handler.dispatchMessage (Handler.java:105) at android.os.Looper.loop (Looper.java:164) at android.app.ActivityThread.main (ActivityThread.java:6944) at java.lang.reflect.Method.invoke (Native Method) at com.android.internal.os.Zygote$MethodAndArgsCaller.run (Zygote.java:327) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1374) Caused by: java.lang.IllegalStateException: at android.app.ContextImpl.startServiceCommon (ContextImpl.java:1538) at android.app.ContextImpl.startService (ContextImpl.java:1484) at android.content.ContextWrapper.startService (ContextWrapper.java:663) at android.content.ContextWrapper.startService (ContextWrapper.java:663) at android.support.v4.content.WakefulBroadcastReceiver.startWakefulService (WakefulBroadcastReceiver.java:99) at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzh (Unknown Source:11) at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.zzb (Unknown Source:78) at com.google.firebase.iid.FirebaseInstanceIdInternalReceiver.onReceive (Unknown Source:25) at android.app.ActivityThread.handleReceiver (ActivityThread.java:3392)

This is my gradle:

apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "xxx.yyyy"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:27.0.2'
    compile 'com.android.support:design:27.0.2'

    // Google Play Service
    compile 'com.google.android.gms:play-services-identity:9.8.0'

    //compile 'com.google.android.gms:play-services-gcm:10.2.1'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    // compile 'com.google.android.gms:play-services-appindexing:9.8.0'

    //compile 'com.google.android.gms:play-services-ads:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'
    compile 'com.google.android.gms:play-services-maps:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'

    // Asynchronous Networking and Image Loading
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.picasso:picasso:2.5.2'

    //Alt-Beacon
    compile 'org.altbeacon:android-beacon-library:2.13.1'

    // Firebase
    //compile 'com.google.firebase:firebase-core:9.8.0'
    //compile 'com.google.firebase:firebase-messaging:9.8.0'

    // Facebook
    implementation 'com.facebook.android:facebook-login:[4,5)'
}

apply plugin: 'apply plugin: 'com.android.application'
android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "xxx.yyyy"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    packagingOptions {
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:27.0.2'
    compile 'com.android.support:design:27.0.2'

    // Google Play Service
    compile 'com.google.android.gms:play-services-identity:9.8.0'

    //compile 'com.google.android.gms:play-services-gcm:10.2.1'
    compile 'com.google.android.gms:play-services-location:9.8.0'
    // compile 'com.google.android.gms:play-services-appindexing:9.8.0'

    //compile 'com.google.android.gms:play-services-ads:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'
    compile 'com.google.android.gms:play-services-maps:9.8.0'
    compile 'com.google.android.gms:play-services-analytics:9.8.0'

    // Asynchronous Networking and Image Loading
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile 'com.google.code.gson:gson:2.8.0'
    compile 'com.squareup.picasso:picasso:2.5.2'

    //Alt-Beacon
    compile 'org.altbeacon:android-beacon-library:2.13.1'

    // Firebase
    //compile 'com.google.firebase:firebase-core:9.8.0'
    //compile 'com.google.firebase:firebase-messaging:9.8.0'

    // Facebook
    implementation 'com.facebook.android:facebook-login:[4,5)'
}

apply plugin: 'com.google.gms.google-services'
Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
LuZa
  • 450
  • 1
  • 6
  • 27
  • 1
    The stack trace indicates this originates in google firebase trying to wake up your app. Android 8 introduces new background restrictions, so it's possible that he version of firebase you are using is not fully compatible with Android 8. The code shown indicates that firebase is commented out, but something is certainly causing it to execute and crash. – davidgyoung Jun 29 '18 at 15:29

0 Answers0