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

Issue when trying to install an apk on older devices #2

Closed
rzv86 opened this issue Oct 8, 2019 · 10 comments
Closed

Issue when trying to install an apk on older devices #2

rzv86 opened this issue Oct 8, 2019 · 10 comments

Comments

@rzv86
Copy link

rzv86 commented Oct 8, 2019

Hello.
I'm using your ANE to install an additional java apk from my adobe air application on android devices.
It's working fine on samsung s8(android 9), lenovo tab p10(android 9), but no success on my older devices: samsung note p600(android 5.1.1), huawei mediapad m2 10(android 5.1.1) or even on samsung s8 (android 7.0).

On the working devices settings can be opened to check "install unknown app"-"allow from this source" and after that my secondary app can be installed, but nothing happens on the older android versions devices. My samsung s8(android 7.0) displays an error: "Package installer has stopped".

I develop app with air sdk 32, starling 2.5.1, feathers 4.0, also i'm using your permission ANE.
Min sdk target 17, target sdk 27.

Thank you,

@marchbold
Copy link
Contributor

Can you post some example code that replicates the issue and the log from the device?

https://airnativeextensions.github.io/tutorials/device-logs

Cheers

@rzv86
Copy link
Author

rzv86 commented Oct 9, 2019

So, I've made 2 logcats, one on the samsung p600(android5.1.1) and one on samsung s8(android 7.0)

logcat p600.docx

logcat samsung s8.docx

can you take a look?

thanks

@marchbold
Copy link
Contributor

Thanks for those, could you try this build for us:

https://www.dropbox.com/s/i90agjh772q9inr/com.distriqt.PackageManager.v2.0.010.zip?dl=0

@rzv86
Copy link
Author

rzv86 commented Oct 10, 2019

I've tried it on my devices, all are working fine except my samsung s8(android 7.0) wich gave me the same error like it did before: "Package installer has stopped".
Below you can find the logcat.

logcat 2 samsung s8.docx

I read on this link- https://stackoverflow.com/questions/54128272/update-app-via-apk-download-with-url-not-showing-open-done-screen - that installing an app is different on newer devices (Build.VERSION.SDK_INT >= 24, meaning android 7.0 nougat ), and you need to ask user to grant permission from settings like we do on samsung 9(android 9) and lenovo tab(android 9).

Also, I've noticed in my new logcat:
Permission Denial: opening provider com.distriqt.extension.packagemanager.content.PackageManagerFileProvider from ProcessRecord{a4d5eae 27934:com.google.android.packageinstaller/u0a34} (pid=27934, uid=10034) that is not exported from uid 10248...
So my first thought was if you treated correctly sdk 24 on your ANE.

Thanks,

@rzv86
Copy link
Author

rzv86 commented Oct 16, 2019

Hello again. Do you have any news on this?

@marchbold
Copy link
Contributor

We are still looking into this one.

@marchbold
Copy link
Contributor

@marchbold
Copy link
Contributor

Regarding your question on requesting permissions you are following the docs on checking canRequestApplicationInstalls and allowing unknown sources? This was only introduced in android 26 not 24.

https://github.com/distriqt/ANE-PackageManager/wiki/u.Installing-Apps

However there are other grant permissions that changed earlier.

@rzv86
Copy link
Author

rzv86 commented Oct 17, 2019

Yes, I check for "canRequestApplicationInstalls" first, if false then I use "PackageManager.service.showManageUnknownAppSourcesSettings();" , user checks unknown sources in settings, after that, in my app:
"if(PackageManager.service.canRequestApplicationInstalls == true){
..
PackageManager.service.installApplication( apkfile.nativePath );
}"

Now your last ANE build work's fine on all my devices.

Thank you.

@marchbold
Copy link
Contributor

Great, glad to hear it's working now, will push this update into release later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants