Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Native Exception on a Pixel 2 XL

Tags:

android

I am experiencing some problems running my app on a Pixel 2 XL.

Yesterday, it was working perfectly, and the app works on the emulator as expected.

Behavior

The first time the app starts it works, launching it again causes an exception on native code.

My App does not have a native library

Exception

2021-03-23 00:05:17.868 14827-14827/? A/DEBUG: Build fingerprint: 'google/taimen/taimen:11/RP1A.201005.004.A1/6934943:user/release-keys'
2021-03-23 00:05:17.868 14827-14827/? A/DEBUG: Revision: 'rev_10'
2021-03-23 00:05:17.868 14827-14827/? A/DEBUG: ABI: 'arm64'
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG: Timestamp: 2021-03-23 00:05:17+0000
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG: pid: 14708, tid: 14708, name: my_app.debug  >>> my.app.package.name.debug <<<
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG: uid: 10364
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG: Cause: null pointer dereference
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x0  0000000000000000  x1  00000070811181ec  x2  7265646f63654400  x3  726f7463656c6553
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x4  0000000000000000  x5  0000000000000000  x6  716e7362646b6452  x7  7f7f7f7f7f7f7f7f
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x8  0101010101010101  x9  0000007080e75000  x10 00000060000373c8  x11 0000007081118488
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x12 00000000ffffffff  x13 0000000000000000  x14 4b3d092f234ec266  x15 cae6c696f68e9634
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x16 00000070851be0f0  x17 000000736eb69870  x18 000000737463e000  x19 0000000000000003
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x20 0000000000000000  x21 000000600001ff40  x22 0000007fdddfe528  x23 00000060000373c8
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x24 00000060000373d8  x25 0000000000000000  x26 0000007fdddfe7c0  x27 0000000000000000
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     x28 00000060000b81a0  x29 0000007fdddfe480
2021-03-23 00:05:17.869 14827-14827/? A/DEBUG:     lr  00000070841499dc  sp  0000007fdddfe450  pc  00000070841499dc  pst 0000000080000000
2021-03-23 00:05:17.870 14827-14827/? A/DEBUG: backtrace:
2021-03-23 00:05:17.870 14827-14827/? A/DEBUG:       #00 pc 00000000034529dc  /data/app/~~XYsxcfPioD_lXrykYiuRug==/com.google.android.webview-BV9BYYU2jmEepqoY1a5GdA==/base.apk!libmonochrome.so (offset 0x2d3000) (BuildId: 95f822edbc9f6b7eae5123e2b88ce8cf430204b4)
2021-03-23 00:05:18.270 921-921/? E/tombstoned: Tombstone written to: /data/tombstones/tombstone_19

The current version of the app on the PlayStore is experiencing the same problem, so I'm pretty confident that this problem is not from a recent change in my code.

What I found

I noticed that the exception referred to a libmonochrome.so I read that this may be related to a WebView, I do have a WebView on my app, but it's a secondary activity and it's not launched when the app starts.

Deleting this activity had no effect.

If I clear the storage the app starts to work, but as soon as I try to reopen it the app closes, and minimizes right away, it stays in the background with a black screen.

This does not make a lot of sense to me, I commented the code that launches the main activity, so basically, I'm just running the splash screen.

I have no problems running the project on an emulator, the emulator displays the Splash activity and does it without causing a Native exception.

SplashActivity.kt

class SplashActivity : BaseActivity() {
   override fun onCreateActivity(savedInstanceState: Bundle?) {
       setContentView(R.layout.activity_splash)
   }
   // commented code...
}

BaseActivity.kt

abstract class BaseActivity : AppCompatActivity() {

   abstract fun onCreateActivity(savedInstanceState: Bundle?)

   override fun onCreate(savedInstanceState: Bundle?) {
       val extras = intent.getBundleExtra("saved_state")
       super.onCreate(savedInstanceState ?: extras)
       requestWindowFeature(Window.FEATURE_NO_TITLE)
       window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN)

       onCreateActivity(savedInstanceState ?: extras)
}
   // used for night mode transitions
   override fun onConfigurationChanged(newConfig: Configuration) {
       super.onConfigurationChanged(newConfig)
       PreferenceManager.getDefaultSharedPreferences(this).edit().putInt(UI_MODE_PREF_KEY, newConfig.uiMode).apply()
       AppCompatDelegate.setDefaultNightMode(newConfig.uiMode)
       transitionRecreate()
}
   // used for night mode transitions
   protected open fun transitionRecreate() {
       val bundle = Bundle()
       onSaveInstanceState(bundle)
       val intent = Intent(this, javaClass)
       intent.putExtra("saved_state", bundle)
       intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
       overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
       startActivity(intent)
   }
}

apply plugin: 'com.android.application'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply plugin: "androidx.navigation.safeargs.kotlin"
apply plugin: 'com.google.firebase.crashlytics'

android {
    packagingOptions {
        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/*.kotlin_module")
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    compileSdkVersion 30
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "my.package"
        minSdkVersion 19
        targetSdkVersion 30
        versionCode 77
        versionName "2.3v"
       // vectorDrawables.useSupportLibrary = true
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        // If set to 'true', enables the instrumentation class to start and stop profiling.
        // If set to false (default), profiling occurs the entire time the instrumentation
        // class is running.
        testHandleProfiling true
        // If set to 'true', indicates that the Android system should run the instrumentation
        // class as a functional test. The default value is 'false'
        testFunctionalTest true
    }


    testOptions {
        unitTests{
            returnDefaultValues = true
        }
    }

    signingConfigs {
        config {
            Properties properties = new Properties()
            properties.load(project.rootProject.file('local.properties').newDataInputStream())
            storeFile file(properties.getProperty('storeFile'))
            keyAlias properties.getProperty('keyAlias')
            storePassword properties.getProperty('storePassword')
            keyPassword properties.getProperty('keyPassword')
        }
    }

    android.buildFeatures.dataBinding = true

    dexOptions {
        javaMaxHeapSize '4g'
    }


    buildTypes {
        release {
            signingConfig signingConfigs.config
            minifyEnabled true
            shrinkResources true
            debuggable true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            proguardFile "proguard-gson.pro"
            proguardFile "proguard-google-play-services.pro"
            proguardFile "proguard-support-v7-appcompat.pro"
            proguardFile "proguard-joda.pro"
        }
        debug {
            debuggable true
            signingConfig signingConfigs.config
            applicationIdSuffix ".debug"
            firebaseCrashlytics {
                // If you don't need crash reporting for your debug build,
                // you can speed up your build by disabling mapping file uploading.
                mappingFileUploadEnabled false
            }
        }
    }
    compileOptions {
        targetCompatibility 1.8
        sourceCompatibility 1.8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }
}


dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation project(':MaterialDialog')

    // Lottie Animation Library
    implementation 'com.airbnb.android:lottie:3.4.4'

    /* Multidex */
    implementation 'androidx.multidex:multidex:2.0.1'


    /* FACEBOOK  */
    implementation 'com.facebook.android:facebook-android-sdk:8.0.0'


    implementation 'com.github.wrdlbrnft:sorted-list-adapter:0.2.0.1'
    implementation 'com.github.chrisbanes:PhotoView:2.1.3'
    implementation 'com.scottyab:aescrypt:0.0.1'
    //implementation 'com.github.traex.rippleeffect:library:1.3'
    implementation 'com.squareup.picasso:picasso:2.71828'
    //implementation 'com.miguelcatalan:materialsearchview:1.4.0'
    implementation 'im.dacer:AndroidCharts:1.0.4'
    implementation 'com.github.greenfrvr:rubber-loader:1.1.2@aar'

    /* SUPPORT LIBRARY */
    implementation "com.google.android.play:core:1.10.0"
    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'com.google.android.material:material:1.3.0'
    implementation 'androidx.appcompat:appcompat: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.preference:preference-ktx:1.1.1"
    implementation "androidx.annotation:annotation:1.1.0"
    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
    implementation "androidx.palette:palette-ktx:1.0.0"
    implementation "androidx.fragment:fragment-ktx:1.3.1"

    /* FIREBASE */
    implementation platform('com.google.firebase:firebase-bom:26.0.0')

    implementation 'com.google.firebase:firebase-crashlytics-ktx'
    implementation 'com.google.firebase:firebase-core:18.0.2'
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.firebaseui:firebase-ui-auth:7.1.0'
    implementation 'com.firebaseui:firebase-ui-database:7.1.0'
    implementation 'com.firebaseui:firebase-ui-auth:7.1.0'

    implementation 'com.google.firebase:firebase-messaging-ktx:21.0.1'
    implementation "com.google.firebase:firebase-auth-ktx:20.0.3"
    implementation "com.google.firebase:firebase-storage-ktx:19.2.1"
    implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
    implementation "com.google.firebase:firebase-ads:19.8.0"
    implementation "com.google.firebase:firebase-config-ktx:20.0.4"
    implementation "com.google.firebase:firebase-perf-ktx:19.1.1"
    implementation "com.google.firebase:firebase-database-ktx:19.7.0"
    implementation "com.google.firebase:firebase-appindexing:19.2.0"
    implementation 'com.google.firebase:firebase-firestore-ktx:22.1.1'
    implementation 'com.google.firebase:firebase-config-ktx:20.0.4'
    implementation 'com.google.firebase:firebase-functions-ktx:19.2.0'
    implementation 'com.google.guava:guava:29.0-jre'

    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'

    implementation 'com.chaos.view:pinview:1.3.2'
    //For playing .gif images
    implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.21'


    // Room components
    implementation "androidx.room:room-runtime:2.2.6"
    kapt "androidx.room:room-compiler:2.2.6"
    androidTestImplementation "androidx.room:room-testing:2.2.6"


    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    implementation "androidx.lifecycle:lifecycle-common-java8:2.3.0"


    // Lifecycle components
    implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
    // annotationProcessor "androidx.lifecycle:lifecycle-compiler:2.1.0"

    /* Retrofit */
    // Max version to support APIS below 21
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:retrofit-converters:2.6.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
    implementation 'com.squareup.retrofit2:converter-moshi:2.9.0'


    implementation 'joda-time:joda-time:2.10.6'

    debugImplementation 'com.sothree.slidinguppanel:library:3.4.0'

    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31"


    implementation 'com.android.billingclient:billing:3.0.3'
    implementation 'com.android.billingclient:billing-ktx:3.0.3'

    kapt "com.android.databinding:compiler:3.3.2"

    //shimmer
    implementation 'com.facebook.shimmer:shimmer:0.5.0'
    // Kotlin + coroutines
    implementation "androidx.work:work-runtime-ktx:2.5.0"
    implementation "androidx.room:room-ktx:2.2.6"

    implementation "com.theartofdev.edmodo:android-image-cropper:2.8.0"

    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.4.1'
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-guava:1.2.1'
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.4.31"

    implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'

    implementation 'com.akexorcist:RoundCornerProgressBar:2.0.3'

    implementation 'com.google.android.ads.consent:consent-library:1.0.8'

    implementation 'androidx.core:core-ktx:1.3.2'
    implementation 'com.google.android:flexbox:2.0.1'
    implementation 'nl.bryanderidder:themed-toggle-button-group:1.1.0'

    implementation 'com.github.strooooke:appbarsyncedfab:v0.5'

    implementation 'androidx.navigation:navigation-fragment-ktx:2.3.4'
    implementation 'androidx.navigation:navigation-ui-ktx:2.3.4'

    implementation 'jp.wasabeef:picasso-transformations:2.2.1'


    // Unit Testing .\
    implementation 'com.google.dagger:dagger:2.31.2'
    kapt 'com.google.dagger:dagger-compiler:2.31.2'
    implementation 'com.google.dagger:dagger-android:2.29.1'
    kapt 'com.google.dagger:dagger-android-processor:2.29.1'

    kaptAndroidTest 'com.google.dagger:dagger-compiler:2.31.2'

    debugImplementation 'androidx.fragment:fragment-ktx:1.3.1'
    debugImplementation ('androidx.fragment:fragment-testing:1.3.0-alpha08', {
        exclude group: 'androidx.test', module: 'core'
    })

    testImplementation 'junit:junit:4.13.2'

    androidTestImplementation 'androidx.test:core:1.3.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
    androidTestImplementation 'androidx.test:runner:1.3.0'
    androidTestImplementation 'androidx.test:rules:1.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
    androidTestImplementation 'org.mockito:mockito-core:3.7.7'
    androidTestImplementation 'org.mockito:mockito-android:3.5.11'
    androidTestImplementation "androidx.navigation:navigation-testing:2.3.4"
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.3.0'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.3.0'
    androidTestImplementation "androidx.work:work-testing:2.5.0"
}

kapt {
    generateStubs = true
}

apply plugin: 'com.google.gms.google-services'
apply plugin: 'kotlin-android-extensions'
repositories {
    mavenCentral()
}

UPDATE

I may be getting somewhere.

So I cloned my project and just started deleting pretty much everything, I ran the app just with the Application class and the SplashActivity

Still the same error, so I started deleting stuff on the Application class

When I deleted this line

MobileAds.initialize(this)

Bingo! It worked.

Deleting this line fixed the problem, I'm trying to understand why this is happening.

UPDATE 2

Looks like Google is trying to fix the issue, it has been reported by several news outlets

like image 514
Tiago Oliveira Avatar asked Mar 23 '21 00:03

Tiago Oliveira


2 Answers

I have the same problem, I found the next "temporary" solution, uninstall the WEBVIEW updates from the device.

WEBVIEW: https://play.google.com/store/apps/details?id=com.google.android.webview

SOURSE: https://www.clubedohardware.com.br/topic/1530756-erro-ao-abrir-apps-j%C3%A1-%C3%A9-o-terceiro/?do=findComment&comment=8132908

It worked for me.

UPDATE

Google released yesterday (March 22) an update to WEBVIEW and GOOGLE CHROME application, download that update and the problem will be fixed.

like image 177
Carlos Esteven Avatar answered Sep 19 '22 22:09

Carlos Esteven


Had the same problem on Xiaomi Mi10T Lite 5G. Just installed Android WebView update (version: 89.0.4389.105) from Google Play and this update solved the problem.

like image 21
yarzombo Avatar answered Sep 23 '22 22:09

yarzombo