簡體   English   中英

Android 崩潰:java.lang.RuntimeException:在 android.app.ActivityThread.performResumeActivity

[英]Android crash: java.lang.RuntimeException: at android.app.ActivityThread.performResumeActivity

此錯誤發生在內部測試中(從未在開發中出現過),並且迄今為止僅針對一位用戶在一台設備上報告過,該設備的規格為:

  • 小米紅米6A
  • 安卓 8.1 (SDK 27)

它也是一個用(一些可能相關的包)構建的 ReactNative 應用程序:

  • “反應原生”:“~0.63.4”,
  • "博覽會": "^41.0.0",
  • "展覽權限": "~12.0.1",

以下是 GooglePlay Console 上的日志:

java.lang.RuntimeException: 
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3657)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3697)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1690)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:176)
  at android.app.ActivityThread.main (ActivityThread.java:6662)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:873)
Caused by: java.lang.NullPointerException: 
  at java.util.Objects.requireNonNull (Objects.java:203)
  at expo.modules.location.LocationModule.handleForegroundLocationPermissions (LocationModule.java:16)
  at expo.modules.location.LocationModule.lambda$requestForegroundPermissionsAsync$2 (LocationModule.java)
  at expo.modules.location.LocationModule.lambda$requestForegroundPermissionsAsync$2$LocationModule (LocationModule.java)
  at expo.modules.location.-$$Lambda$LocationModule$k4oVIWX5Tq-1bJGiv_G_lWYmJ10.onResult (-.java:4)
  at org.unimodules.adapters.react.permissions.PermissionsService$createListenerWithPendingPermissionsRequest$1.onRequestPermissionsResult (PermissionsService.java:32)
  at com.facebook.react.ReactActivityDelegate$2.invoke (ReactActivityDelegate.java:20)
  at com.facebook.react.ReactActivityDelegate.onResume (ReactActivityDelegate.java:12)
  at com.facebook.react.ReactActivity.onResume (ReactActivity.java:5)
  at android.app.Instrumentation.callActivityOnResume (Instrumentation.java:1355)
  at android.app.Activity.performResume (Activity.java:7182)
  at android.app.ActivityThread.performResumeActivity (ActivityThread.java:3632)
  at android.app.ActivityThread.handleResumeActivity (ActivityThread.java:3697)
  at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1690)
  at android.os.Handler.dispatchMessage (Handler.java:106)
  at android.os.Looper.loop (Looper.java:176)
  at android.app.ActivityThread.main (ActivityThread.java:6662)
  at java.lang.reflect.Method.invoke (Native Method)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:547)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:873)

下面也是應用程序的 MainActivity,如果有幫助的話


    // Added automatically by Expo Config
    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        Intent intent = new Intent("onConfigurationChanged");
        intent.putExtra("newConfig", newConfig);
        sendBroadcast(intent);
    }

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(null);
    // SplashScreen.show(...) has to be called after super.onCreate(...)
    // Below line is handled by '@expo/configure-splash-screen' command and it's discouraged to modify it manually
    SplashScreen.show(this, SplashScreenImageResizeMode.CONTAIN, ReactRootView.class, false);
  }


    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "main";
    }

    @Override
    protected ReactActivityDelegate createReactActivityDelegate() {
        return new ReactActivityDelegate(this, getMainComponentName()) {
            @Override
            protected ReactRootView createRootView() {
                return new RNGestureHandlerEnabledRootView(MainActivity.this);
            }
        };
    }
}

任何幫助將不勝感激!

我也承認,使用 Crashlytics 之類的任何工具都會讓生活更輕松,而且目前還沒有集成它們。 但如果這是解決問題的唯一方法,我也可能會這樣做,稍后..謝謝!

似乎沒有授予位置許可

java.lang.NullPointerException: at java.util.Objects.requireNonNull (Objects.java:203) at expo.modules.location.LocationModule.handleForegroundLocationPermissions (LocationModule.java:16) at expo.modules.location.LocationModule.lambda$requestForegroundPermissionsAsync$2 (LocationModule.java) at expo.modules.location.LocationModule.lambda$requestForegroundPermissionsAsync$2$LocationModule (LocationModule.java)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM