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

Nothing happened when I called OtaUpdate().excute #22

Closed
hoangquy4897 opened this issue Dec 31, 2019 · 14 comments
Closed

Nothing happened when I called OtaUpdate().excute #22

hoangquy4897 opened this issue Dec 31, 2019 · 14 comments
Labels
integration problem Problem is not in plugin itself but related to how you use the plugin.

Comments

@hoangquy4897
Copy link

hoangquy4897 commented Dec 31, 2019

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');
}
}
`

@hoangquy4897
Copy link
Author

Does this package only work with rooted device?

@Wanhooo
Copy link

Wanhooo commented Jan 17, 2020

此软件包仅适用于有根设备吗?

我也是没有反应,请问你得问题解决了么

@hoangquy4897
Copy link
Author

此软件包仅适用于有根设备吗?

我也是没有反应,请问你得问题解决了么

Try this: https://medium.com/apolloblog/building-an-in-app-updater-ota-in-flutter-b0becddee8ca
It's work for me. I think this is how this package implement also.

@MartinHlavna
Copy link
Member

@hoangquy4897

Please provide output from flutter doctor and log output for more information. Is your link publicly accessible?

@hoangquy4897
Copy link
Author

@hoangquy4897

Please provide output from flutter doctor and log output for more information. Is your link publicly accessible?

The link is private and only can access from our wireless. Nothing happens when i ran it and I have tried to debug it. Maybe it only work with https so it can't download the apk file.

@MartinHlavna
Copy link
Member

So it is mac filtered? Http should not be problem. We are using android download manager in android implementation to download the APK.

@hoangquy4897
Copy link
Author

So it is mac filtered? Http should not be problem. We are using android download manager in android implementation to download the APK.

I have checked all the files in device but can't find the apk. By the way, when the apk file is opened. Does it automatic install and open the app or it just show the install screen then I have to tap the install button? If it not, I can use the other solution above, it's work for me but it can't automatic install for me. Thanks you

@MartinHlavna
Copy link
Member

It is strange it should at least print some logs and possibly a StackTrace if it crashed somewhere upon calling the execute method.

As for your question It will open standard install wizard.

@MartinHlavna
Copy link
Member

I have accidentally reproduced this behavior, when running example.

We have moved our server that hosts apk to another domain and it behaved exactly the same as download manager encountered 404 HTTP error and scheduled paused download request for retry.

So I think there may be two possible reasons for your error:

  1. You have a typo in url or APK is not available from phone for some other reason
  2. Android download manager has problem with your url. Maybe downloading from browser on phone will provide more information?

Next version will have improved logging.

@MartinHlavna MartinHlavna added the integration problem Problem is not in plugin itself but related to how you use the plugin. label Jan 17, 2020
@Wanhooo
Copy link

Wanhooo commented Jan 19, 2020

此例外仅适用于有根设备吗?

我也是没有反应,请问你得问题解决了么

试试这个:https : //medium.com/apolloblog/building-an-in-app-updater-ota-in-flutter-b0becddee8ca
对我来说这是工作。我认为这也是该包实现的方式。

此例外仅适用于有根设备吗?

我也是没有反应,请问你得问题解决了么

试试这个:https : //medium.com/apolloblog/building-an-in-app-updater-ota-in-flutter-b0becddee8ca
对我来说这是工作。我认为这也是该包实现的方式。

我找到了我得问题,因为我是用的安卓自带模拟器cpu为x86-64架构,而我的apk文件只支持arm,在使用第三方模拟器后就解决了

@hoangquy4897
Copy link
Author

I have accidentally reproduced this behavior, when running example.

We have moved our server that hosts apk to another domain and it behaved exactly the same as download manager encountered 404 HTTP error and scheduled paused download request for retry.

So I think there may be two possible reasons for your error:

  1. You have a typo in url or APK is not available from phone for some other reason
  2. Android download manager has problem with your url. Maybe downloading from browser on phone will provide more information?

Next version will have improved logging.

I can download the apk file from browser normally. I have used dio package to download apk file and it work but it not work with your package.Maybe the problem come from the device cuz the others one use your package is still working.

@MartinHlavna
Copy link
Member

They are probably not using download manager.

Solution may be to use optional parameter to bypass download manager and download APK with any java http client, but that would probably cause to loose download progress.

@ethael
Copy link
Member

ethael commented Jun 22, 2020

non active issue. closing.

@ethael ethael closed this as completed Jun 22, 2020
@ChenArno
Copy link

me too find it,but 3.1.0 is ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration problem Problem is not in plugin itself but related to how you use the plugin.
Projects
None yet
Development

No branches or pull requests

5 participants