本文介绍了Pixel 2 XL上的本机异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Pixel 2 XL上运行我的应用程序时遇到一些问题.

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.

该应用首次启动时,再次启动会导致本机代码异常.

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

我的应用没有本地库

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

PlayStore上的当前应用程序版本也遇到了相同的问题,因此,我非常有信心这个问题并非源于我的代码的最新更改.

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.

我注意到引用了 libmonochrome.so 的异常,我读到它可能与WebView有关,我的应用程序上确实有一个WebView,但这是辅助活动,并且未启动当应用启动时.

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.

删除此活动无效.

如果我清除了存储空间,则该应用程序开始工作,但是当我尝试重新打开该存储库时,该应用程序将关闭并立即最小化,它会在黑屏的背景下停留.

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.

我在模拟器上运行项目没有问题,模拟器显示Splash活动,并且在不引起本机异常的情况下执行了该活动.

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

SplashActivity.kt

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

BaseActivity.kt

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.

所以我克隆了我的项目,并开始删除几乎所有内容,我只使用 Application 类和 SplashActivity

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

仍然是相同的错误,所以我开始删除Application类上的内容

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

当我删除此行

MobileAds.initialize(this)

宾果!奏效了.

删除此行可解决问题,我试图了解为什么会发生这种情况.

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

好象Google试图解决这个问题,它已经被多家新闻媒体报道

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

推荐答案

我遇到了同样的问题,我发现了下一个临时"问题.解决方案,请从设备上卸载WEBVIEW更新.

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

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

对我有用.

更新

Google昨天(3月22日)发布了对WEBVIEW和GOOGLE CHROME应用程序的更新,请下载该更新,此问题将得到解决.

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

这篇关于Pixel 2 XL上的本机异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-10 18:07