Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app crash when launch using ota_update #41

Closed
walterFeng opened this issue Sep 2, 2020 · 3 comments
Closed

app crash when launch using ota_update #41

walterFeng opened this issue Sep 2, 2020 · 3 comments
Labels
waiting-for-response Further information is requested

Comments

@walterFeng
Copy link

walterFeng commented Sep 2, 2020

android app crash when using ota_update

✗ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, 1.22.0-9.0.pre, on Mac OS X 10.15.6 19G2021, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
[✓] Android Studio (version 3.5)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

crash log:

2020-09-02 17:36:25.818 13408-13408/cc.yourdream.sunmi E/CrashReport: sys default last handle start!
2020-09-02 17:36:25.818 13408-13408/cc.yourdream.sunmi E/AndroidRuntime: FATAL EXCEPTION: main
    Process: cc.yourdream.sunmi, PID: 13408
    java.lang.RuntimeException: Unable to start activity ComponentInfo{cc.yourdream.sunmi/cc.yourdream.sunmi.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Looper android.content.Context.getMainLooper()' on a null object reference
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2665)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
        at android.app.ActivityThread.-wrap12(ActivityThread.java)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:154)
        at android.app.ActivityThread.main(ActivityThread.java:6119)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.os.Looper android.content.Context.getMainLooper()' on a null object reference
        at sk.fourq.otaupdate.OtaUpdatePlugin.<init>(OtaUpdatePlugin.java:74)
        at sk.fourq.otaupdate.OtaUpdatePlugin.registerWith(OtaUpdatePlugin.java:96)
        at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:19)
        at cc.yourdream.sunmi.MainActivity.configureFlutterEngine(MainActivity.kt:28)
        at cc.yourdream.sunmi.MainActivity.onCreate(MainActivity.kt:41)
        at android.app.Activity.performCreate(Activity.java:6679)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726at android.app.ActivityThread.-wrap12(ActivityThread.javaat android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477at android.os.Handler.dispatchMessage(Handler.java:102at android.os.Looper.loop(Looper.java:154at android.app.ActivityThread.main(ActivityThread.java:6119at java.lang.reflect.Method.invoke(Native Methodat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776

Generated Registrant file:

/**
 * Generated file. Do not edit.
 * This file is generated by the Flutter tool based on the
 * plugins that support the Android platform.
 */
@Keep
public final class GeneratedPluginRegistrant {
  public static void registerWith(@NonNull FlutterEngine flutterEngine) {
    ShimPluginRegistry shimPluginRegistry = new ShimPluginRegistry(flutterEngine);
    flutterEngine.getPlugins().add(new io.flutter.plugins.connectivity.ConnectivityPlugin());
      sk.fourq.otaupdate.OtaUpdatePlugin.registerWith(shimPluginRegistry.registrarFor("sk.fourq.otaupdate.OtaUpdatePlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.packageinfo.PackageInfoPlugin());
    flutterEngine.getPlugins().add(new io.flutter.plugins.pathprovider.PathProviderPlugin());
    flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
  }
}

Any suggestions to me ? Look forward to your reply.

@iperfectapp
Copy link

Same problem!

@MartinHlavna
Copy link
Member

Hi, how do you run the Application? Looks like android context is null for some reason. (registrar.getActivity() or registrar.getContext()).

@MartinHlavna MartinHlavna added the waiting-for-response Further information is requested label Mar 25, 2021
@MartinHlavna
Copy link
Member

Closing because of no activity. Feel free to reopen if you can provide more info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting-for-response Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants