Git Product home page Git Product logo

ota_update's People

Contributors

chronm avatar ethael avatar evgfilim1 avatar justsaybien avatar kmtong avatar martinhlavna avatar tchunwei avatar techgeekd avatar vasilich6107 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ota_update's Issues

app crash when launch using ota_update

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.

Install failed

When the installation runs it, comes back with "App not installed". There is nothing in the console.

It seems to get stuck a long time on value 99. In the console i see a few

OTA UPDATE TRACK DOWNLOAD RUNNING

and then a LOT of

OTA UPDATE PAUSED. REASON IS (CHECK AGAINST PAUSED_ CONSTANTS OF DownloadManager: 1

Thereafter, it asks me if I want to install. It starts the installation and then the error above happens.

Crash app

exception: ged_boost_gpu_freq, level 100, eOrigin 2, final_idx 2, oppidx_max 2, oppidx_min 0,
and crash app when close app use ota update

Download progress is negative

I/flutter ( 5080): 57
I/flutter ( 5080): 57
I/flutter ( 5080): -56
I/flutter ( 5080): -56
I/flutter ( 5080): -54
I/flutter ( 5080): -54

After 50% -57%, they all become negative values ​​and decrease.
version:

  • ota_update 2.0.2

Hope to fix, thanks for providing!

android9 device update failed,automatically quits. but less than android 9 normal.

The following is the error log:
Launching lib\main.dart on PCT AL10 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Syncing files to device PCT AL10...
I/flutter (17644): newestVersionName:0.9.98
I/flutter (17644): currentVersionName:0.9.97
I/AwareBitmapCacher(17644): init lrucache size: 2097152 pid=17644
D/ZrHung.AppEyeUiProbe(17644): stop checker.
D/ZrHung.AppEyeUiProbe(17644): Current Activity:false
D/ZrHung.AppEyeUiProbe(17644): not watching, wait.
I/flutter (17644): OTA status: OtaStatus.DOWNLOADING : 0
I/qianxinanmobil(17644): Starting profile saver IsSaveProfileNow end.
I/flutter (17644): OTA status: OtaStatus.INSTALLING :
W/libEGL (17644): EGLNativeWindowType 0x71ee981010 disconnect failed
I/SurfaceView(17644): delay destroy surface control
W/libEGL (17644): EGLNativeWindowType 0x71f87fd010 disconnect failed
I/SurfaceView(17644): need destroy surface control
D/ViewRootImplMainActivity: surface should not be released
D/ZrHung.AppEyeUiProbe(17644): notify runnable to start.
D/ZrHung.AppEyeUiProbe(17644): restart watching
D/ZrHung.AppEyeUiProbe(17644): notify runnable to start.
D/ZrHung.AppEyeUiProbe(17644): stop checker.
D/ActivityThread(17644): Remove activity client record, r= ActivityRecord{3e9c0bd token=android.os.BinderProxy@c41d34e {com.longruan.qianxinanmobile/com.longruan.qianxinanmobile.MainActivity}} token= android.os.BinderProxy@c41d34e
D/AndroidRuntime(17644): Shutting down VM
E/AndroidRuntime(17644): FATAL EXCEPTION: main
E/AndroidRuntime(17644): Process: com.longruan.qianxinanmobile, PID: 17644
E/AndroidRuntime(17644): java.lang.NullPointerException: Attempt to invoke virtual method 'io.flutter.app.FlutterPluginRegistry io.flutter.view.FlutterNativeView.getPluginRegistry()' on a null object reference
E/AndroidRuntime(17644): at io.flutter.view.FlutterView.getPluginRegistry(FlutterView.java:219)
E/AndroidRuntime(17644): at io.flutter.view.FlutterView.onDetachedFromWindow(FlutterView.java:685)
E/AndroidRuntime(17644): at android.view.View.dispatchDetachedFromWindow(View.java:18592)
E/AndroidRuntime(17644): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3817)
E/AndroidRuntime(17644): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3817)
E/AndroidRuntime(17644): at android.view.ViewGroup.dispatchDetachedFromWindow(ViewGroup.java:3817)
E/AndroidRuntime(17644): at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:4089)
E/AndroidRuntime(17644): at android.view.ViewRootImpl.doDie(ViewRootImpl.java:7427)
E/AndroidRuntime(17644): at android.view.ViewRootImpl.die(ViewRootImpl.java:7387)
E/AndroidRuntime(17644): at android.view.WindowManagerGlobal.removeViewLocked(WindowManagerGlobal.java:521)
E/AndroidRuntime(17644): at android.view.WindowManagerGlobal.removeView(WindowManagerGlobal.java:452)
E/AndroidRuntime(17644): at android.view.WindowManagerImpl.removeViewImmediate(WindowManagerImpl.java:208)
E/AndroidRuntime(17644): at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:5141)
E/AndroidRuntime(17644): at android.app.servertransaction.DestroyActivityItem.execute(DestroyActivityItem.java:39)
E/AndroidRuntime(17644): at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:145)
E/AndroidRuntime(17644): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:70)
E/AndroidRuntime(17644): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2155)
E/AndroidRuntime(17644): at android.os.Handler.dispatchMessage(Handler.java:109)
E/AndroidRuntime(17644): at android.os.Looper.loop(Looper.java:207)
E/AndroidRuntime(17644): at android.app.ActivityThread.main(ActivityThread.java:7539)
E/AndroidRuntime(17644): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17644): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524)
E/AndroidRuntime(17644): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
I/Process (17644): Sending signal. PID: 17644 SIG: 9
Lost connection to device.

App closes when starts installing

Since I updated to Flutter 1.12, ota_update doesn't work. When I call it, it downloads the new APK, and when the Status = INSTALLING the app crashes. It logs nothing neither with nor without verbose.

Please fix!

Samsung Galaxy J3(2017) Android 9

Fatal Exception: java.lang.ArithmeticException: divide by zero
       at sk.fourq.otaupdate.OtaUpdatePlugin$1.handleMessage(OtaUpdatePlugin.java:61)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:216)
       at android.app.ActivityThread.main(ActivityThread.java:7188)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)

Suddenly it doesn't work

D/FLUTTER OTA(11665): OTA UPDATE ON LISTEN
E/EventChannel#sk.fourq.ota_update(11665): Failed to open event stream
E/EventChannel#sk.fourq.ota_update(11665): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
E/EventChannel#sk.fourq.ota_update(11665): at sk.fourq.otaupdate.OtaUpdatePlugin.onListen(OtaUpdatePlugin.java:123)
E/EventChannel#sk.fourq.ota_update(11665): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:188)
E/EventChannel#sk.fourq.ota_update(11665): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:167)
E/EventChannel#sk.fourq.ota_update(11665): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/EventChannel#sk.fourq.ota_update(11665): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:631)
E/EventChannel#sk.fourq.ota_update(11665): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#sk.fourq.ota_update(11665): at android.os.MessageQueue.next(MessageQueue.java:326)
E/EventChannel#sk.fourq.ota_update(11665): at android.os.Looper.loop(Looper.java:165)
E/EventChannel#sk.fourq.ota_update(11665): at android.app.ActivityThread.main(ActivityThread.java:6864)
E/EventChannel#sk.fourq.ota_update(11665): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#sk.fourq.ota_update(11665): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
E/EventChannel#sk.fourq.ota_update(11665): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

════════ Exception caught by services library ══════════════════════════════════════════════════════
The following PlatformException was thrown while activating platform stream on channel sk.fourq.ota_update:
PlatformException(error, Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference, null)

When the exception was thrown, this was the stack:
#0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156:18)

#2 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:329:12)
#3 EventChannel.receiveBroadcastStream. (package:flutter/src/services/platform_channel.dart:519:29)
...

suport ios APP update

does it support the update of the app on ios?,i mean jump to the app page in the app store

I add this to my package's pubspec.yaml file

D8: Program type already present: androidx.cursoradapter.widget.CursorAdapter$ChangeObserver

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.

com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\91.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\73.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\88.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\67.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\82.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\58.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\94.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\85.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\70.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\97.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\64.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\76.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\61.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\79.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\14.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\19.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\4.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\9.jar, D:\testmyapp\werong_app\build\app\intermediates\transforms\dexBuilder\debug\31.jar,

Nothing happened when I called OtaUpdate().excute

I have implemented as the instruction and I have try to download the apk with the link to check if it can be downloaded or not. However, there is nothing happen when I call OtaUpdate().excute(), this is my code:

`
Future updateApp() async {

// RUN OTA UPDATE

// START LISTENING FOR DOWNLOAD PROGRESS REPORTING EVENTS
print("test update app");
try {
//LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
OtaUpdate().execute('http://172.16.0.39:9001/fsmart-door/static/FSmartDoor.apk?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=admin%2F20191231%2F%2Fs3%2Faws4_request&X-Amz-Date=20191231T043606Z&X-Amz-Expires=432000&X-Amz-SignedHeaders=host&X-Amz-Signature=3465870fde98ca8dcee12a982bff67ea6657cfd8e822f7b7602c42bf4d16562a').listen(
(OtaEvent event) {
print('EVENT: ${event.status} : ${event.value}');
},
);
} catch (e) {
print('Failed to make OTA update. Details: $e');
}
}
`

Error receiving broadcast Intent android.intent.action.DOWNLOAD_COMPLETE

Hi there!
I'm using this plugin as update tool, and when I just about to finish downloading, as logs displayed at 99%, the app shutdown.
My code was almost the same as the example, but not in main.dart, and using custom event to handle the event change.

static Future<void> tryOtaUpdate() async {
  try {
    if (Platform.isAndroid) {
      OtaUpdate().execute(Api.latestAndroid).listen((OtaEvent event) {
        Constants.eventBus.fire(new OTAEvent(event));
      });
    } else if (Platform.isIOS) {
      OtaUpdate().execute(Api.latestIOS).listen((OtaEvent event) {
        Constants.eventBus.fire(new OTAEvent(event));
      });
    }
  } catch (e) {
    print('Failed to make OTA update. Details: $e');
  }
}
class OTAEvent {
  OtaEvent otaEvent;
  OTAEvent(OtaEvent _otaEvent) {
    this.otaEvent = _otaEvent;
  }
}
eventBus.on<OTAEvent>().listen((event) {
  if (this.mounted) {
    setState(() {
      this.otaEvent = event.otaEvent;
    });
    print('OTA status: ${this.otaEvent.status} : ${this.otaEvent.value}');
  }
});
I/flutter (27797): OTA status: OtaStatus.DOWNLOADING : 99
E/AndroidRuntime(27797): FATAL EXCEPTION: main
E/AndroidRuntime(27797): Process: cn.xxx.xxx.xxxxxxx, PID: 27797
E/AndroidRuntime(27797): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=cn.xxx.xxx.xxxxxxx (has extras) } in sk.fourq.otaupdate.OtaUpdatePlugin$1@50892f

I dont know what is it. please fix!

Xiaomi Redmi 5 Plus Android 8.1.0

Fatal Exception: android.database.CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
       at android.database.AbstractCursor.checkPosition(AbstractCursor.java:474)
       at android.database.AbstractWindowedCursor.checkPosition(AbstractWindowedCursor.java:136)
       at android.database.AbstractWindowedCursor.getLong(AbstractWindowedCursor.java:74)
       at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
       at android.database.CursorWrapper.getLong(CursorWrapper.java:127)
       at android.app.DownloadManager$CursorTranslator.getLong(DownloadManager.java:1798)
       at android.app.DownloadManager$CursorTranslator.getInt(DownloadManager.java:1788)
       at sk.fourq.otaupdate.OtaUpdatePlugin$3.run(OtaUpdatePlugin.java:34)
       at java.lang.Thread.run(Thread.java:764)

There was a problem parsing the package.

In my case, the higher version can be manually installed through a downloaded .apk file while the lower version exist, so I assume my .apk file was fine.

But when I install the higher version through OTA, it will throw an error after OtaStatus.DOWNLOADING and OtaStatus.INSTALLING, and after installation failed, I got an OTA UPDATE SUCCESS.

The OTA process worked well before, when I was using the debug signing keys. And I was using my release signing when I find this error. Maybe there's some issue related to app signing?

OTA UPDATE FAILURE: 1005

when i check the document
it shows:

ERROR_TOO_MANY_REDIRECTS
Added in API level 9
public static final int ERROR_TOO_MANY_REDIRECTS
Value of COLUMN_REASON when there were too many redirects.

Constant Value: 1005 (0x000003ed)

how can i solve this problem?

Problem parsing package & OTA Update Failure: 400

Hi !
I have some problems implementing OTA update. I don't think it's a problem of link or file because I can manually install the app by downloading it.
When I try to update my app (using the same code as the example you gave), this happens (permissions have been granted) :

D/FLUTTER OTA( 5335): OTA UPDATE ON LISTEN
D/FLUTTER OTA( 5335): OTA UPDATE ON STARTING DOWNLOAD
D/FLUTTER OTA( 5335): OTA UPDATE DOWNLOAD STARTED 4479
D/FLUTTER OTA( 5335): OTA UPDATE TRACK DOWNLOAD STARTED 4479
D/FLUTTER OTA( 5335): OTA UPDATE TRACK DOWNLOAD THREAD STARTED 4479
D/FLUTTER OTA( 5335): OTA UPDATE PENDING
D/FLUTTER OTA( 5335): OTA UPDATE FAILURE: 400

And then I have the "There was a problem parsing the package." message on the screen. When I go to my download folder, there is no apk file. I tested with and without checksum, and with it I have the same results, minus the message on screen.
If it can help, I'm using a Xiaomi Mi A2 (Android 10) for my tests.

Thank you !

Downloading not fired in case of download from GoogleDrive

Hi. Thanks for your work!

I found a little issue. In case if I download the file via share link from google drive the DOWNLOADING event not fired.

In case of browser download form the same link there is no sign of the whole file size(related to how google streams file to browser) - it seems to be the root cause of the issue.

apk包60M,更新的时候OtaUpdate的值更新的时候;更新进度 会先正数然后变成负数

try {
//LINK CONTAINS APK OF FLUTTER HELLO WORLD FROM FLUTTER SDK EXAMPLES
OtaUpdate().execute(widget.data.apkUrl).listen(
(OtaEvent event) {
print('开始下载中');
print('下载状态' + event.status.toString());
print('下载速度' + event.value);
setState(() {
currentEvent = event;
if (int.parse(event.value) == 0) {
percent = 1;
} else {
percent = int.parse(event.value);
}
});
},
);
-----------------分割--------------------------更新着慢慢的朝着奇奇怪怪的方向发展了----------------

I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度3
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度8
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度13
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度30
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-27
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度-14
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度0
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度10
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.DOWNLOADING
I/flutter ( 703): 下载速度20
I/flutter ( 703): 开始下载中
I/flutter ( 703): 下载状态OtaStatus.INSTALLING

replace downloaded file

Hi,
it's not a bug but I would know if it's possible replace the destination file because into download folder there are a lot of apk file with same name.
Thanks

java.lang.NoSuchMethodError: No virtual method checkSelfPermission(Ljava/lang/String;)

E/flutter (12613): at android.app.ActivityThread.main(ActivityThread.java:5667)
E/flutter (12613): at java.lang.reflect.Method.invoke(Native Method)
E/flutter (12613): at java.lang.reflect.Method.invoke(Method.java:372)
E/flutter (12613): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:962)
E/flutter (12613): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)
E/flutter (12613):
F/flutter (12613): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(77)] Check failed: CheckException(env).
F/libc (12613): Fatal signal 6 (SIGABRT), code -6 in tid 12613

flutter doctor -v
[√] Flutter (Channel stable, v1.7.8+hotfix.3, on Microsoft Windows [Version 10.0.17763.592], locale ru-RU)
• Flutter version 1.7.8+hotfix.3 at C:\flutter
• Framework revision b712a172f9 (2 weeks ago), 2019-07-09 13:14:38 -0700
• Engine revision 54ad777fd2
• Dart version 2.4.0

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at C:\Users\yona\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 37.0.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] VS Code (version 1.36.1)
• VS Code at C:\Users\yona\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.2.0

[√] Connected device (1 available)
• TIT L01 • ################ • android-arm64 • Android 5.1 (API 22)

! Doctor found issues in 1 category.

PlatformException

I/flutter (22346): ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ I/flutter (22346): The following PlatformException was thrown while activating platform stream on channel I/flutter (22346): sk.fourq.ota_update: I/flutter (22346): PlatformException(error, Attempt to invoke virtual method 'java.lang.String I/flutter (22346): java.lang.Object.toString()' on a null object reference, null) I/flutter (22346): I/flutter (22346): When the exception was thrown, this was the stack: I/flutter (22346): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7) I/flutter (22346): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33) I/flutter (22346): <asynchronous suspension> I/flutter (22346): #2 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:517:29) I/flutter (22346): #4 EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:503:64)

I use this plug which version is 2.2.1 , but a PlatformException occurs .Please give some suggests ,thanks.

MissingPluginException due to missing listen method implementation

I am using the example as given, made the manifest file changes and created the xml folder and file.

Flutter details:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.3, on Microsoft Windows [Version 10.0.19041.508], locale en-GB)

At runtime I get this error:

image

MissingPluginException

18:34:11.068 130 info flutter.tools [ ] I/flutter (31605): MissingPluginException(No implementation found for method listen on channel sk.fourq.ota_update)

java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE

java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=com.ps.zhizuxia (has extras) } in sk.fourq.otaupdate.a@29239c0c
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:928)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:134)
    at android.app.ActivityThread.main(ActivityThread.java:5377)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference
    at sk.fourq.otaupdate.a.onReceive()
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:906)
    ... 8 more
java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.EventChannel$EventSink.success(java.lang.Object)' on a null object reference
    at sk.fourq.otaupdate.a.onReceive()
    at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:906)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:134)
    at android.app.ActivityThread.main(ActivityThread.java:5377)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:967)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)

Apk name

is there a solution for changing name for the apk when its downloading/downloaded?

No virtual method checkSelfPermission

No virtual method checkSelfPermission(Ljava/lang/String;)I in class Landroid/app/Activity; or its super classes (declaration of 'android.app.Activity' appears in /system/framework/framework.jar)
E/flutter (11380): at sk.fourq.otaupdate.OtaUpdatePlugin.onListen(OtaUpdatePlugin.java:71)

Android: 5.0.1
API:21

can't download file

I can't download apk form link,
I receive Exception OTA UPDATE PAUSED. REASON IS (CHECK AGAINST PAUSED_ CONSTANTS OF DownloadManager: 1

Failed to open event stream

This error occurred when i call OtaUpdate().execute(url):

D/FLUTTER OTA(  438): OTA UPDATE ON LISTEN
E/EventChannel#sk.fourq.ota_update(  438): Failed to open event stream
E/EventChannel#sk.fourq.ota_update(  438): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
E/EventChannel#sk.fourq.ota_update(  438): 	at sk.fourq.otaupdate.OtaUpdatePlugin.onListen(OtaUpdatePlugin.java:98)
E/EventChannel#sk.fourq.ota_update(  438): 	at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:193)
E/EventChannel#sk.fourq.ota_update(  438): 	at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:172)
E/EventChannel#sk.fourq.ota_update(  438): 	at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/EventChannel#sk.fourq.ota_update(  438): 	at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/EventChannel#sk.fourq.ota_update(  438): 	at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#sk.fourq.ota_update(  438): 	at android.os.MessageQueue.next(MessageQueue.java:336)
E/EventChannel#sk.fourq.ota_update(  438): 	at android.os.Looper.loop(Looper.java:174)
E/EventChannel#sk.fourq.ota_update(  438): 	at android.app.ActivityThread.main(ActivityThread.java:7356)
E/EventChannel#sk.fourq.ota_update(  438): 	at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#sk.fourq.ota_update(  438): 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E/EventChannel#sk.fourq.ota_update(  438): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

════════ Exception caught by services library ══════════════════════════════════════════════════════
The following PlatformException was thrown while activating platform stream on channel sk.fourq.ota_update:
PlatformException(error, Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference, null)

When the exception was thrown, this was the stack: 
#0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569:7)
#1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321:33)
<asynchronous suspension>
#2      EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:517:29)
#4      EventChannel.receiveBroadcastStream.<anonymous closure> (package:flutter/src/services/platform_channel.dart:503:64)
...
════════════════════════════════════════════════════════════════════════════════════════════════════

and this is my GeneratedPluginRegistrant.java file:

package io.flutter.plugins;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.plugins.shim.ShimPluginRegistry;

/**
 * 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);
      com.smallbuer.flutter_aes_ecb_pkcs5.FlutterAesEcbPkcs5Plugin.registerWith(shimPluginRegistry.registrarFor("com.smallbuer.flutter_aes_ecb_pkcs5.FlutterAesEcbPkcs5Plugin"));
    flutterEngine.getPlugins().add(new com.dexterous.flutterlocalnotifications.FlutterLocalNotificationsPlugin());
      io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin.registerWith(shimPluginRegistry.registrarFor("io.flutter.plugins.flutter_plugin_android_lifecycle.FlutterAndroidLifecyclePlugin"));
      me.hetian.flutter_qr_reader.FlutterQrReaderPlugin.registerWith(shimPluginRegistry.registrarFor("me.hetian.flutter_qr_reader.FlutterQrReaderPlugin"));
      com.flutter_webview_plugin.FlutterWebviewPlugin.registerWith(shimPluginRegistry.registrarFor("com.flutter_webview_plugin.FlutterWebviewPlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.imagepicker.ImagePickerPlugin());
      sk.fourq.otaupdate.OtaUpdatePlugin.registerWith(shimPluginRegistry.registrarFor("sk.fourq.otaupdate.OtaUpdatePlugin"));
    flutterEngine.getPlugins().add(new io.flutter.plugins.packageinfo.PackageInfoPlugin());
    flutterEngine.getPlugins().add(new com.baseflow.permissionhandler.PermissionHandlerPlugin());
    flutterEngine.getPlugins().add(new io.flutter.plugins.sharedpreferences.SharedPreferencesPlugin());
    flutterEngine.getPlugins().add(new io.flutter.plugins.urllauncher.UrlLauncherPlugin());
  }
}

and flutter doctor -v:

[✓] Flutter (Channel stable, v1.12.13+hotfix.9, on Mac OS X 10.15.4 19E287, locale zh-Hans-CN)
    • Flutter version 1.12.13+hotfix.9 at /Users/shawn/flutter
    • Framework revision f139b11009 (4 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8
    • Dart version 2.7.2

 
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    • Android SDK at /Users/shawn/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.4, Build version 11E146
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.44.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.9.1

[!] Proxy Configuration
    • HTTP_PROXY is set
    ! NO_PROXY is not set

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)

! Doctor found issues in 1 category.

Update README

Readme is missing instruction to create filepaths.xml file.
Relative path to project root and file content should be specified.
Also, short info where it's used and why should be specified.

In instructions for modifying AndroidManifest.xml file i believe it would be worth mentioning that provider node goes inside application node and provide link to AndroidManifest.xml file in example.

Thanks for the plugin! :)

permission UNKNOWN_APP_SOURCES

Using for example install_plugin during installation the application asked for permission"Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES)", here the user is not asked and the installation fails.

When the application package is downloaded, cancel the download and the application exits.

Hi!

When the application package is downloaded, cancel the download and the application exits.

I/OpenGLRenderer(28955): Initialized EGL, version 1.4
E/AndroidRuntime(28955): FATAL EXCEPTION: Thread-7
E/AndroidRuntime(28955): Process: com.******, PID: 28955
E/AndroidRuntime(28955): java.lang.NullPointerException: Attempt to invoke interface method 'boolean android.database.Cursor.moveToFirst()' on a null object reference
E/AndroidRuntime(28955): at sk.fourq.otaupdate.OtaUpdatePlugin$3.run(OtaUpdatePlugin.java:293)
E/AndroidRuntime(28955): at java.lang.Thread.run(Thread.java:776)
I/Process (28955): Sending signal. PID: 28955 SIG: 9
Lost connection to device.

Flutter 1.17.5 channel stable.
ota_update: ^2.4.1

Thanks!

Multiple Flutter apps with ota_update plugin fails to install

If i implement ota_update in one app and installs it, and if i again use this plugin in another flutter app then the other app fails to install giving this error message
[INSTALL_FAILED_CONFLICTING_PROVIDER: Package couldn't be installed in /data/app/com.*cause provider name sk.fourq.ota_update.provider (in package com.*.demo) is already used by com.*.demo]

(* package name hidden)

This error arises due to same authorities in more than one app ie 'sk.fourq.ota_update.provider'. This can be resolved if one changes the authorities in getUriForFile method in OtaUpdatePlugin.
For this i need to manually add the git repo of this project in my app.

ios can't run

implicit conversion of 'int' to 'id _Nullable' is disallowed with ARC

Android: 5.0.1 No virtual method checkSelfPermission

No virtual method checkSelfPermission(Ljava/lang/String;)I in class Landroid/app/Activity; or its super classes (declaration of 'android.app.Activity' appears in /system/framework/framework.jar)
E/flutter (11380): at sk.fourq.otaupdate.OtaUpdatePlugin.onListen(OtaUpdatePlugin.java:71)

Android: 5.0.1
API:21

Problem parsing the package

there was a problem parsing the package is an error that I get

I tired using the sha-256checksum but I always get this error (file not found)

meanwhile if I opened the downloaded package from the file manger it works

my thinking that it installs before the download is finishes?

Failed to open event stream

This problem occurred when I was using it, and the Android files were all configured. Why? My Flutter version is 1.12+9

E/EventChannel#sk.fourq.ota_update(15952): Failed to open event stream
E/EventChannel#sk.fourq.ota_update(15952): java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference
E/EventChannel#sk.fourq.ota_update(15952): at sk.fourq.otaupdate.OtaUpdatePlugin.onListen(OtaUpdatePlugin.java:123)
E/EventChannel#sk.fourq.ota_update(15952): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onListen(EventChannel.java:193)
E/EventChannel#sk.fourq.ota_update(15952): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler.onMessage(EventChannel.java:172)
E/EventChannel#sk.fourq.ota_update(15952): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:93)
E/EventChannel#sk.fourq.ota_update(15952): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:642)
E/EventChannel#sk.fourq.ota_update(15952): at android.os.MessageQueue.nativePollOnce(Native Method)
E/EventChannel#sk.fourq.ota_update(15952): at android.os.MessageQueue.next(MessageQueue.java:336)
E/EventChannel#sk.fourq.ota_update(15952): at android.os.Looper.loop(Looper.java:181)
E/EventChannel#sk.fourq.ota_update(15952): at android.app.ActivityThread.main(ActivityThread.java:7520)
E/EventChannel#sk.fourq.ota_update(15952): at java.lang.reflect.Method.invoke(Native Method)
E/EventChannel#sk.fourq.ota_update(15952): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/EventChannel#sk.fourq.ota_update(15952): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I/flutter (15952): Another exception was thrown: PlatformException(error, Attempt to invoke virtual method 'java.lang.String java.lang.Object.toString()' on a null object reference, null)

When installing, there was a crash and exit problem

Hi:
In the Android real mobile phone environment, after I downloaded the APK file using the plug-in, the APK file could not be opened automatically, and the App crashed. The specific reasons for the error are as follows:

E/AndroidRuntime(17033): java.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.DOWNLOAD_COMPLETE flg=0x10 pkg=com.example.financial_choice (has extras) } in sk.fourq.otaupdate.OtaUpdatePlugin$2@dc692f4
E/AndroidRuntime(17033): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1566)
E/AndroidRuntime(17033): at android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run(Unknown Source:2)
E/AndroidRuntime(17033): at android.os.Handler.handleCallback(Handler.java:883)
E/AndroidRuntime(17033): at android.os.Handler.dispatchMessage(Handler.java:100)
E/AndroidRuntime(17033): at android.os.Looper.loop(Looper.java:224)
E/AndroidRuntime(17033): at android.app.ActivityThread.main(ActivityThread.java:7560)
E/AndroidRuntime(17033): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(17033): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/AndroidRuntime(17033): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/AndroidRuntime(17033): Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.INSTALL_PACKAGE dat=content://com.example.financial_choice.ota_update_provider/external_download/ZeRong flg=0x10000001 }
E/AndroidRuntime(17033): at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2066)
E/AndroidRuntime(17033): at android.app.Instrumentation.execStartActivity(Instrumentation.java:1720)
E/AndroidRuntime(17033): at android.app.Activity.startActivityForResult(Activity.java:5260)
E/AndroidRuntime(17033): at android.app.Activity.startActivityForResult(Activity.java:5218)
E/AndroidRuntime(17033): at android.app.Activity.startActivity(Activity.java:5589)
E/AndroidRuntime(17033): at android.app.Activity.startActivity(Activity.java:5557)
E/AndroidRuntime(17033): at sk.fourq.otaupdate.OtaUpdatePlugin$2.onReceive(OtaUpdatePlugin.java:262)
E/AndroidRuntime(17033): at android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args(LoadedApk.java:1556)
E/AndroidRuntime(17033): ... 8 more
E/MQSEventManagerDelegate(17033): failed to get MQSService.
D/JIGUANG-JCommon-P(17033): [JCommonInterface] onEvent action:deviceinfo
D/JIGUANG-JCore-P(17033): [HttpHelper] status code:200 retry left:2
I/Process (17033): Sending signal. PID: 17033 SIG: 9

App crash when call 'OtaUpdate().execute'

E/AndroidRuntime( 7534): FATAL EXCEPTION: Thread-2
E/AndroidRuntime( 7534): Process: com.chuangdun.cysy, PID: 7534
E/AndroidRuntime( 7534): java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: Thread-2
E/AndroidRuntime( 7534): at io.flutter.embedding.engine.FlutterJNI.ensureRunningOnMainThread(FlutterJNI.java:605)
E/AndroidRuntime( 7534): at io.flutter.embedding.engine.FlutterJNI.dispatchPlatformMessage(FlutterJNI.java:515)
E/AndroidRuntime( 7534): at io.flutter.embedding.engine.dart.DartMessenger.send(DartMessenger.java:76)
E/AndroidRuntime( 7534): at io.flutter.embedding.engine.dart.DartExecutor.send(DartExecutor.java:151)
E/AndroidRuntime( 7534): at io.flutter.view.FlutterNativeView.send(FlutterNativeView.java:144)
E/AndroidRuntime( 7534): at io.flutter.plugin.common.EventChannel$IncomingStreamRequestHandler$EventSinkImplementation.success(EventChannel.java:226)
E/AndroidRuntime( 7534): at sk.fourq.otaupdate.OtaUpdatePlugin$2.run(OtaUpdatePlugin.java:179)
E/AndroidRuntime( 7534): at java.lang.Thread.run(Thread.java:764)


flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, v1.7.1, on Microsoft Windows [Version 10.0.17763.503], locale zh-CN)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[!] VS Code, 64-bit edition (version 1.34.0)
X Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[√] Connected device (1 available)

! Doctor found issues in 1 category.


install failed

java.lang.ClassNotFoundException: Didn't find class "sk.fourq.otaupdate.OtaUpdateFileProvider" on path: DexPathList[[zip file "/data/app/com.cbwx.pad_android-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.cbwx.pad_android-1, /vendor/lib, /system/lib]]

Installing multiple times fails

Hello,

I'm getting a "There was a problem parsing the package." when I attempt to download and install the same package multiple times. It seems to not download the file, a zero byte file in the downloads folder.

Steps to reproduce:

  1. Sideload the app as you see fit.
  2. Run the app.
  3. Trigger the OTA update and install the app you downloaded. In my case the exact same apk I originally sideloaded.
  4. After it successfully installs trigger the OTA update again.
  5. It will instantly fail with the error message "There was a problem parsing the package.".

It feels like the plugin thinks that the file has already been downloaded but it hasn't finished the download.

Any ideas?

Thank you,
Michael

Update does not start

Hi there,

update does not start, it says "There was a problem parsing the package". But the package has about 20mb, it says that right away, so it does not start the download at all.

Thank you for any help.

Cheers,
Jan

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.