应用程序在Oreo上不断崩溃:android.app.RemoteServiceException:Context.startForegroundService()然后未调用Service.startForeground()

时间:2018-08-07 06:54:52

标签: android android-service android-8.0-oreo

App在Oreo版本上一直崩溃,我的知识有限,因此请共享,在其他版本中,它的运行正常。当我尝试登录(api)并返回到相似的页面时,会发生此错误并崩溃到Facebook供稿页面,其中包含recyclerview

LogCat:

08-07 10:33:29.519 1929-1929/com.myscrap E/AndroidRuntime: FATAL EXCEPTION: main
                                                           Process: com.myscrap, PID: 1929
                                                           android.app.RemoteServiceException: Context.startForegroundService() did not then call Service.startForeground()
                                                               at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1775)
                                                               at android.os.Handler.dispatchMessage(Handler.java:105)
                                                               at android.os.Looper.loop(Looper.java:164)
                                                               at android.app.ActivityThread.main(ActivityThread.java:6541)
                                                               at java.lang.reflect.Method.invoke(Native Method)
                                                               at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
                                                               at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

这是我的应用程序gradle文件

成绩:应用

apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.jakewharton.hugo'

repositories
        {
    maven { url 'https://maven.fabric.io/public' }
    maven { url "https://jitpack.io" }
    maven { url "https://dl.bintray.com/hani-momanii/maven" }
    google()
}



android
        {

    compileSdkVersion 27
    buildToolsVersion '27.0.2'
    defaultConfig {
        applicationId "com.myscrap"
        minSdkVersion 16
        targetSdkVersion 27
        multiDexEnabled true
        versionCode 146
        versionName "2.4.6"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        vectorDrawables.useSupportLibrary = true
    }
    buildTypes
            {
                release
                        {
                            shrinkResources false
                            minifyEnabled false
                            debuggable false
                            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                        }
            }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

            /*Modified By Ussaid Iqbal Starts here*/
            packagingOptions {
                exclude 'META-INF/CHANGES'
                exclude 'META-INF/DEPENDENCIES'
                exclude 'META-INF/LICENSE'
                exclude 'META-INF/LICENSE.txt'
                exclude 'META-INF/license.txt'
                exclude 'META-INF/NOTICE'
                exclude 'META-INF/NOTICE.txt'
                exclude 'META-INF/notice.txt'
                exclude 'META-INF/ASL2.0'
                exclude 'META-INF/README.md'
                exclude 'META-INF/rxjava.properties'

            }
            /*Modified By Ussaid Iqbal End here*/


}


ext {
    smackVersion = '4.2.4'
}

configurations {
    all {
        exclude group: 'xpp3', module: 'xpp3'
    }
}




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.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
                transitive = true
            }
            compile('io.socket:socket.io-client:0.8.3') {
                exclude group: 'org.json', module: 'json'
            }

            /*compile 'com.google.android.gms:play-services:10.2.4'*/
            compile 'com.google.android.gms:play-services-location:11.8.0'
            compile 'com.android.support:support-v4:27.1.0'
            compile 'com.android.support:support-v13:27.1.0'
            compile 'com.android.support:support-compat:27.1.0'
            compile 'com.android.support:support-fragment:27.1.0'
            compile 'com.android.support:appcompat-v7:27.1.0'
            compile 'com.android.support:animated-vector-drawable:27.1.0'
            compile 'com.android.support:cardview-v7:27.1.0'
            compile 'com.android.support:recyclerview-v7:27.1.0'
            compile 'com.android.support:design:27.1.0'
            compile 'com.android.support:customtabs:27.1.0'
            compile 'com.android.support:support-annotations:27.1.0'
            compile 'com.android.support.constraint:constraint-layout:1.0.2'
            compile 'com.android.support:multidex:1.0.3'
            compile 'com.google.firebase:firebase-core:11.8.0'
            compile 'com.google.firebase:firebase-messaging:11.8.0'
            compile 'com.google.firebase:firebase-appindexing:11.8.0'
            compile 'com.squareup.retrofit2:retrofit:2.3.0'
            compile 'com.squareup.retrofit2:converter-gson:2.3.0'
            compile 'com.squareup.retrofit2:adapter-rxjava:2.3.0'
            compile 'com.squareup.okhttp3:logging-interceptor:3.6.0'
            compile 'com.squareup.okhttp:okhttp:2.3.0'
            compile 'com.google.code.gson:gson:2.8.0'
            compile 'io.reactivex:rxjava:1.3.0'
            compile 'io.reactivex:rxandroid:1.2.1'
            compile 'id.zelory:compressor:1.0.4'
            compile 'com.mcxiaoke.volley:library:1.0.19'
            implementation 'com.github.bumptech.glide:glide:4.5.0'
            annotationProcessor 'com.github.bumptech.glide:compiler:4.5.0'
            compile 'com.jakewharton:butterknife:8.8.1'
            compile 'com.jakewharton.timber:timber:4.5.1'
            compile 'com.squareup.picasso:picasso:2.5.2'
            compile 'com.commonsware.cwac:camera:0.7.0'
            compile 'com.google.android.gms:play-services-gcm:11.8.0'
            compile 'com.google.android.gms:play-services-places:11.8.0'
            compile 'com.google.maps.android:android-maps-utils:0.4.3'
            compile 'com.google.android.gms:play-services-auth:11.8.0'
            compile 'com.androidmapsextensions:android-maps-extensions:2.2.0'
            compile 'com.google.android.gms:play-services-maps:11.8.0'
            compile 'com.google.android.gms:play-services-analytics:11.8.0'
            compile 'com.wang.avi:library:2.1.3'
            compile 'com.github.clans:fab:1.6.4'
            compile 'hani.momanii.supernova_emoji_library:supernova-emoji-library:0.0.2'
            compile 'me.leolin:ShortcutBadger:1.1.13@aar'
            compile 'com.soundcloud.android:android-crop:1.0.1@aar'
            compile 'org.greenrobot:eventbus:3.0.0'
            compile 'com.fenchtose.nocropper:nocropper:0.2.1'
            compile 'com.android.support:exifinterface:27.1.0'
            compile 'com.afollestad.material-dialogs:commons:0.9.4.5'
            compile 'com.github.myinnos:AlphabetIndex-Fast-Scroll-RecyclerView:1.0.5'
            compile 'com.googlecode.libphonenumber:libphonenumber:7.2.2'
            compile 'com.facebook.fresco:fresco:1.4.0'
            compile 'me.relex:photodraweeview:1.1.3'
            compile 'org.jsoup:jsoup:1.11.3'
            testCompile 'junit:junit:4.12'
            compile 'com.github.myinnos:AwesomeImagePicker:1.0.2'
            compile 'com.cocosw:bottomsheet:1.+@aar'
            compile 'org.apache.commons:commons-lang3:3.4'
            annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
            /* 08-01-2018 Bitmap efficient decoding*/
            compile 'com.amitshekhar.android:glide-bitmap-pool:0.0.1'
            compile 'com.github.douglasjunior:android-simple-tooltip:0.2.2'
            // this line must be included to integrate with Firebase
            compile "org.igniterealtime.smack:smack-tcp:$smackVersion"
            compile "org.igniterealtime.smack:smack-experimental:$smackVersion"
            compile "org.igniterealtime.smack:smack-android:$smackVersion"
            compile "org.igniterealtime.smack:smack-android-extensions:$smackVersion"
            compile "org.igniterealtime.smack:smack-im:$smackVersion"
            compile "org.igniterealtime.smack:smack-core:$smackVersion"
            implementation files('libs/callbackOnOffline.jar')
        }
apply plugin: 'com.google.gms.google-services'

0 个答案:

没有答案