4

We are struggling with this issue since months and never

java.lang.SecurityException in android.os.Parcel.readException

We tried various solutions found here on StackOverflow, but any of those solved our issue. We know that is a common problem, but the lack of a real solution is a problem.

Has anyone a possible approach to solve this everywhere?

java.lang.RuntimeException: 
  at android.os.AsyncTask$3.done (AsyncTask.java:365)
  at java.util.concurrent.FutureTask.finishCompletion (FutureTask.java:383)
  at java.util.concurrent.FutureTask.setException (FutureTask.java:252)
  at java.util.concurrent.FutureTask.run (FutureTask.java:271)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
  at java.lang.Thread.run (Thread.java:784)
Caused by: java.lang.SecurityException: 
  at android.os.Parcel.readException (Parcel.java:1954)
  at android.os.Parcel.readException (Parcel.java:1900)
  at android.app.job.IJobCallback$Stub$Proxy.completeWork (IJobCallback.java:218)
  at android.app.job.JobParameters.completeWork (JobParameters.java:220)
  at androidx.core.app.JobIntentService$JobServiceEngineImpl$WrapperWorkItem.complete (JobIntentService.java:268)
  at androidx.core.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:394)
  at androidx.core.app.JobIntentService$CommandProcessor.doInBackground (JobIntentService.java:383)
  at android.os.AsyncTask$2.call (AsyncTask.java:345)
  at java.util.concurrent.FutureTask.run (FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1162)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:636)
  at java.lang.Thread.run (Thread.java:784)

this is less frequent, but we also have it

java.lang.NullPointerException: 
  at android.os.Parcel.readException (Parcel.java:1608)
  at android.os.Parcel.readException (Parcel.java:1555)
  at android.app.job.IJobCallback$Stub$Proxy.jobFinished (IJobCallback.java:167)
  at android.app.job.JobService$JobHandler.handleMessage (JobService.java:147)
  at android.os.Handler.dispatchMessage (Handler.java:102)
  at android.os.Looper.loop (Looper.java:150)
  at android.app.ActivityThread.main (ActivityThread.java:5621)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:794)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:684)

Gradle file

buildscript {
    repositories {
        maven {
            url 'https://maven.fabric.io/public'
        }
        google()
    }
}
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'

repositories {
    maven { url "https://jitpack.io" }
    maven { url 'https://maven.fabric.io/public' }
    maven { url 'https://maven.google.com' }
    maven { url 'https://github.com/500px/500px-android-blur/raw/master/releases/' }
    maven { url "https://dl.bintray.com/microsoftazuremobile/SDK" }
    google()
}


android {
    compileSdkVersion 29
    defaultConfig {
        applicationId '****************'
        minSdkVersion 21
        targetSdkVersion 29
        versionCode 32310206
        versionName '4.3.2'

        //impostare all'api level minimo supportato
        renderscriptTargetApi 21
        renderscriptSupportModeEnabled true

        // Enabling multidex support.
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/maven/com.google.code.gson/gson/pom.properties'
        exclude 'META-INF/maven/com.google.code.gson/gson/pom.xml'
        exclude 'error_prone/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Annotations.gwt.xml'
        exclude 'third_party/java_src/error_prone/project/annotations/Google_internal.gwt.xml'
    }

    signingConfigs {
        release {
            storeFile file("/Library/AndroidKeys/******.keystore")
            storePassword '********'
            keyAlias "**********"
            keyPassword '*************'
        }

    }

    buildTypes {
        release {
            signingConfig signingConfigs.release
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            zipAlignEnabled true
        }
        debug {
            debuggable true
            versionNameSuffix " debug"

            FirebasePerformance {
                //MOMENTANEAMENTE INSERISCO QUESTA OPZIONE PER OVVIARE ALL'ERRORE
                //https://stackoverflow.com/questions/58369285/illegal-class-file-class-module-info-is-missing-a-super-type-class-file-versio
                // Set this flag to 'false' to disable @AddTrace annotation processing and
                // automatic HTTP/S network request monitoring
                // for a specific build variant at compile time.
                instrumentationEnabled false
            }
        }
    }

    lintOptions {
        checkReleaseBuilds false
        // Or, if you prefer, you can continue to check for errors in release builds,
        // but continue the build even when errors are found:
        abortOnError false
    }

    applicationVariants.all { variant ->

        //Aggiungo nelle stringhe nome e codice versione
        variant.resValue "string", "versionName", variant.versionName
        variant.resValue "string", "versionCode", "$variant.versionCode"
        variant.outputs.each { output ->
            def newName = output.outputFile.name
            newName = newName.replace("-release", "-" + defaultConfig.versionName + "vc" + defaultConfig.versionCode)
            newName = newName.replace("-debug", "-DEBUG-" + defaultConfig.versionName + "vc" + defaultConfig.versionCode)
            //noinspection GroovyAssignabilityCheck
            output.outputFileName = "${newName}"
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.vectordrawable:vectordrawable-animated:1.1.0'
    implementation 'androidx.browser:browser:1.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'com.google.code.gson:gson:2.8.6'

    implementation 'com.google.ads.interactivemedia.v3:interactivemedia:3.17.0'

    implementation 'org.prebid:prebid-mobile-sdk:1.4'
    implementation 'com.google.android.gms:play-services-ads:19.0.0'
    //GOOGLE
    implementation 'com.google.android.gms:play-services-base:17.1.0'
    implementation 'com.google.firebase:firebase-messaging:20.1.1'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'
    implementation 'com.google.android.gms:play-services-location:17.0.0'
    implementation 'com.google.firebase:firebase-appindexing:19.1.0'
    implementation 'com.google.firebase:firebase-invites:17.0.0'
    implementation 'com.google.firebase:firebase-core:17.2.3'
    implementation 'com.google.firebase:firebase-config:19.1.2'
    implementation 'com.google.firebase:firebase-perf:19.0.5'
    implementation 'com.android.volley:volley:1.1.0'
    //JetPack
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
    implementation 'com.github.bumptech.glide:glide:4.10.0'
    annotationProcessor 'androidx.annotation:annotation:1.1.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.10.0'
    implementation 'com.github.bumptech.glide:okhttp3-integration:4.10.0'
    implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0-alpha'
    implementation 'com.microsoft.azure:notification-hubs-android-sdk:0.6@aar'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.loopj.android:android-async-http:1.4.9'
    implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
    api 'com.outbrain.obsdk:obsdk:3.7.10'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.github.MikeOrtiz:TouchImageView:1.4.0'
    implementation 'org.osmdroid:osmdroid-android:6.1.5'
    implementation 'org.osmdroid:osmdroid-wms:6.1.5'
    implementation 'org.jetbrains:annotations:15.0'
    implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.6.2'
}

apply plugin: 'com.google.gms.google-services'
Andrea
  • 41
  • 3
  • share the code, highlighting the lines where the errors are – Abhinav Chauhan Mar 07 '20 at 13:04
  • 3
    I see this type of error too. Reading the traces - nothing in the stacktrace points back to any line of code outside of core anrdroid & java components or gives a clue what would be causing it. Can you share the app build.gradle file? Maybe there's a common library. – Tyler V Mar 07 '20 at 14:29
  • please provide more information on the context. Which action or situation produces this error? I guess that the java.lang.NullPointerException is a different problem, please focus just on the first one – Panciz Mar 07 '20 at 15:21
  • Added the gradle file. I cannot add any specific part of the code cause it's not in a specific part that the error is triggered. – Andrea Mar 09 '20 at 08:37
  • Any feedback here? – Andrea Mar 12 '20 at 08:47
  • Sorry, no ideas. Only non-standard library I see in common with mine is MPAndroidChart. Of course it could be coming from that, or any of the other common ones like firebase, play-services, etc... – Tyler V Mar 20 '20 at 03:46

0 Answers0