1

此错误发生在内部测试中(在开发中从未见过),并且到目前为止仅报告了一个用户,在一台设备上,其规格为:

  • 小米红米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 之类的工具都会让生活变得更轻松,而且它们目前还没有集成。但是,如果这是唯一可以解决的方法,我也可以这样做,稍后……谢谢!

4

1 回答 1

0

似乎没有授予位置权限

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)

于 2021-07-23T13:01:04.603 回答