You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
D/FLUTTER OTA(14386): STREAM OPENED
D/FLUTTER OTA(14386): REQUEST PERMISSIONS RESULT RECEIVED
D/FLUTTER OTA(14386): DOWNLOAD STARTING
E/AndroidRuntime(14386): FATAL EXCEPTION: main
E/AndroidRuntime(14386): Process: kr.co.klcns.mrs_app, PID: 14386
E/AndroidRuntime(14386): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=0, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {kr.co.klcns.mrs_app/kr.co.klcns.mrs_app.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(14386): at android.app.ActivityThread.deliverResults(ActivityThread.java:5864)
E/AndroidRuntime(14386): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5903)
E/AndroidRuntime(14386): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
E/AndroidRuntime(14386): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
E/AndroidRuntime(14386): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(14386): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(14386): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
E/AndroidRuntime(14386): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14386): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(14386): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(14386): at android.app.ActivityThread.main(ActivityThread.java:8663)
E/AndroidRuntime(14386): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14386): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(14386): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/AndroidRuntime(14386): Caused by: java.lang.NullPointerException
E/AndroidRuntime(14386): at k1.a.b(Unknown Source:38)
E/AndroidRuntime(14386): at io.flutter.embedding.engine.c$c.h(Unknown Source:20)
E/AndroidRuntime(14386): at io.flutter.embedding.engine.c.b(Unknown Source:14)
E/AndroidRuntime(14386): at io.flutter.embedding.android.d.y(Unknown Source:59)
E/AndroidRuntime(14386): at io.flutter.embedding.android.c.onRequestPermissionsResult(Unknown Source:10)
E/AndroidRuntime(14386): at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8833)
E/AndroidRuntime(14386): at android.app.Activity.dispatchActivityResult(Activity.java:8663)
E/AndroidRuntime(14386): at android.app.ActivityThread.deliverResults(ActivityThread.java:5857)
E/AndroidRuntime(14386): ... 13 more
OtaUpdate().execute(url, headers: {'Accept': 'application/octet-stream'},).listen(
(OtaEvent event) async {
switch (event.status) {
case OtaStatus.CANCELED:
break;
case OtaStatus.ALREADY_RUNNING_ERROR:
break;
case OtaStatus.CHECKSUM_ERROR:
break;
case OtaStatus.PERMISSION_NOT_GRANTED_ERROR:
break;
case OtaStatus.DOWNLOAD_ERROR:
break;
case OtaStatus.INTERNAL_ERROR:
break;
case OtaStatus.DOWNLOADING:
try {
try {
add(LoginPageUpdateChanged(event: event, version: otaUpdateVersion.version));
} on StateError catch (e) {
FileLogger.write('Failed to make OTA update. Details: $e');
}
} on StateError catch (e) {
FileLogger.write('Failed to make OTA update. Details: $e');
}
break;
case OtaStatus.INSTALLING:
try {
add(LoginPageInitEvent());
} on StateError catch (e) {
FileLogger.write('Failed to make OTA update. Details: $e');
}
FileLogger.write("tryOtaUpdate: $event");
break;
}
},
);
} catch (e) {
FileLogger.write('Failed to make OTA update. Details: $e');
}
}
`
How to catch this error? Sometimes unexpected happen. Any idea?
The text was updated successfully, but these errors were encountered:
D/FLUTTER OTA(14386): STREAM OPENED
D/FLUTTER OTA(14386): REQUEST PERMISSIONS RESULT RECEIVED
D/FLUTTER OTA(14386): DOWNLOAD STARTING
E/AndroidRuntime(14386): FATAL EXCEPTION: main
E/AndroidRuntime(14386): Process: kr.co.klcns.mrs_app, PID: 14386
E/AndroidRuntime(14386): java.lang.RuntimeException: Failure delivering result ResultInfo{who=@android:requestPermissions:, request=0, result=-1, data=Intent { act=android.content.pm.action.REQUEST_PERMISSIONS (has extras) }} to activity {kr.co.klcns.mrs_app/kr.co.klcns.mrs_app.MainActivity}: java.lang.NullPointerException
E/AndroidRuntime(14386): at android.app.ActivityThread.deliverResults(ActivityThread.java:5864)
E/AndroidRuntime(14386): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5903)
E/AndroidRuntime(14386): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:54)
E/AndroidRuntime(14386): at android.app.servertransaction.ActivityTransactionItem.execute(ActivityTransactionItem.java:45)
E/AndroidRuntime(14386): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(14386): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(14386): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2438)
E/AndroidRuntime(14386): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(14386): at android.os.Looper.loopOnce(Looper.java:226)
E/AndroidRuntime(14386): at android.os.Looper.loop(Looper.java:313)
E/AndroidRuntime(14386): at android.app.ActivityThread.main(ActivityThread.java:8663)
E/AndroidRuntime(14386): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(14386): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
E/AndroidRuntime(14386): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
E/AndroidRuntime(14386): Caused by: java.lang.NullPointerException
E/AndroidRuntime(14386): at k1.a.b(Unknown Source:38)
E/AndroidRuntime(14386): at io.flutter.embedding.engine.c$c.h(Unknown Source:20)
E/AndroidRuntime(14386): at io.flutter.embedding.engine.c.b(Unknown Source:14)
E/AndroidRuntime(14386): at io.flutter.embedding.android.d.y(Unknown Source:59)
E/AndroidRuntime(14386): at io.flutter.embedding.android.c.onRequestPermissionsResult(Unknown Source:10)
E/AndroidRuntime(14386): at android.app.Activity.dispatchRequestPermissionsResult(Activity.java:8833)
E/AndroidRuntime(14386): at android.app.Activity.dispatchActivityResult(Activity.java:8663)
E/AndroidRuntime(14386): at android.app.ActivityThread.deliverResults(ActivityThread.java:5857)
E/AndroidRuntime(14386): ... 13 more
Here my snippet:
`
void _onVersionUpdate(VersionUpdate event, Emitter emit) async {
SharedPreferences prefs = await SharedPreferences.getInstance();
String protocol = prefs.containsKey('protocol') ? prefs.getString('protocol')! : "https";
String host = prefs.containsKey('host') ? prefs.getString('host')! : "0.0.0.0";
int port = prefs.containsKey('port') ? prefs.getInt('port')! : 0;
String jwt = prefs.containsKey('token') ? prefs.getString('token')! : "";
PackageInfo packageInfo = await PackageInfo.fromPlatform();
try {
OtaUpdateVersion otaUpdateVersion = await HttpClientService().getVersion(protocol, host, port, jwt, packageInfo.version);
String path = otaUpdateVersion.path;
final String url = sprintf("%s://%s:%s/%s", [protocol, host, port, path]);
} catch (e) {
FileLogger.write('Failed to make OTA update. Details: $e');
}
}
`
How to catch this error? Sometimes unexpected happen. Any idea?
The text was updated successfully, but these errors were encountered: