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

Android 10 PackageInstaller support #21

Open
Adevien opened this issue Jan 6, 2023 · 20 comments
Open

Android 10 PackageInstaller support #21

Adevien opened this issue Jan 6, 2023 · 20 comments

Comments

@Adevien
Copy link

Adevien commented Jan 6, 2023

Hey, could you add support for android 10 ?

@vanlooverenkoen
Copy link
Member

Can you give some guidance what is not working on android 10?

@Adevien
Copy link
Author

Adevien commented Jan 7, 2023

Hi, there is a problem on android 10 or higher on the App Store Distribute.

Basically when the download is finished the application crashes, seems to be related with the fact that android 10+ does not allow packages download through Download Manager API but now it needs to use the Package Installer.

I've attached few logs.

Stack traces of the crash

android.app.Instrumentation.checkStartActivityResult Instrumentation.java:2076
android.app.Instrumentation.execStartActivity Instrumentation.java:1720
android.app.ContextImpl.startActivity ContextImpl.java:1000
android.app.ContextImpl.startActivity ContextImpl.java:971
android.content.ContextWrapper.startActivity ContextWrapper.java:389
j.a.onReceive
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args LoadedApk.java:1648
android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run
android.os.Handler.handleCallback Handler.java:883
android.os.Handler.dispatchMessage Handler.java:100
android.os.Looper.loop Looper.java:237
android.app.ActivityThread.main ActivityThread.java:8167
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:496
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1100
android.app.LoadedApk$ReceiverDispatcher$Args.lambda$getRunnable$0$LoadedApk$ReceiverDispatcher$Args LoadedApk.java:1658
android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run
android.os.Handler.handleCallback Handler.java:883
android.os.Handler.dispatchMessage Handler.java:100
android.os.Looper.loop Looper.java:237
android.app.ActivityThread.main ActivityThread.java:8167
java.lang.reflect.Method.invoke Method.java
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run RuntimeInit.java:496
com.android.internal.os.ZygoteInit.main ZygoteInit.java:1100

And the second type of crash

android.app.Instrumentation.checkStartActivityResult Instrumentation.java:2076
android.app.Instrumentation.execStartActivity Instrumentation.java:1720
android.app.ContextImpl.startActivity ContextImpl.java:1000
android.app.ContextImpl.startActivity ContextImpl.java:971
android.content.ContextWrapper.startActivity ContextWrapper.java:389
be.vanlooverenkoen.appcenter_release_manager.AppcenterReleaseManagerPlugin$installApp$onComplete$1.onReceive AppcenterReleaseManagerPlugin.kt:71
android.app.-$$Lambda$LoadedApk$ReceiverDispatcher$Args$_BumDX2UKsnxLVrE6UJsJZkotuA.run
android.os.Handler.handleCallback Handler.java:883
android.os.Handler.dispatchMessage Handler.java:100
android.os.Looper.loop Looper.java:237
android.app.ActivityThread.main ActivityThread.java:8167

@vanlooverenkoen
Copy link
Member

Hmm strange because I am using this package until the beginning on the latest Android version.
Which device are you using? And what is your exact android sdk version?

@Adevien
Copy link
Author

Adevien commented Jan 7, 2023

Galaxy Note 9, and the sdk is 33

@Adevien Adevien closed this as completed Jan 7, 2023
@Adevien
Copy link
Author

Adevien commented Jan 7, 2023

Sorry for reopening, did you came to a conclusion to what is the problem?

@vanlooverenkoen
Copy link
Member

I need to do some investigation. I am currently updating the package first. So it has the latest dependencies & dart target

@Adevien
Copy link
Author

Adevien commented Jan 7, 2023

Ok, wish you good look, until then I'll fallback to PWA cause i'm near deadline and already spent 2 days on it :)

@vanlooverenkoen
Copy link
Member

I would not be surprised if it is a Samsung bug :D but I will take a look at it.

@Adevien
Copy link
Author

Adevien commented Jan 7, 2023

Its not. Same issue appears on a non samsung device. It has to do with something about the download manager. They no longer allowe package installs through it and mentioned some new api. PackageInstaller, found this in appcenter issue browsing.

@vanlooverenkoen
Copy link
Member

If possible can you send me this issue?
Because I can't reproduce it. Running on a Pixel 6 Pro with Android 13

@vanlooverenkoen
Copy link
Member

Are you having the same issue with the example project?
Is obfuscation enabled?

@Adevien
Copy link
Author

Adevien commented Jan 9, 2023

Hi, i can't find the issue on github anymore and I lack the time to look into it right now. Best I can do is try the example project but I need to modify the minSdkVersion to 21 so i can run the analytics, but I will try the example as it is and let you know if it works or not.

@vanlooverenkoen
Copy link
Member

You don't need to update the example project. Just test if you can install something from appcenter. the example project is there so you don't need to add extra code.

@Adevien
Copy link
Author

Adevien commented Jan 9, 2023

Ok, will let you know.

@Adevien
Copy link
Author

Adevien commented Jan 18, 2023

Hey, i've got around to test the sample, it does work, and found my problem, I wrongly assumed its used to self-update an application, but turns out its meant to act as an application release manager, my apologies for wasting your time, but I thought it might work as a self-update on the same app.

@vanlooverenkoen
Copy link
Member

No problem. it can be used to self-update the app. But if you are distributing on the playstore there is no need to implement such a feature. This should only be used if you are distributing only on appcenter.
I use it for alpha, beta testing versions.

@Adevien
Copy link
Author

Adevien commented Jan 18, 2023

I am not distributing on app store, its for an in-house application, but I couldn't get a hold on making it self-update, same as before the activity dies.

@vanlooverenkoen
Copy link
Member

And is it possible to install other applications?

@Adevien
Copy link
Author

Adevien commented Jan 18, 2023

Only others, but not self-update

@vanlooverenkoen
Copy link
Member

Can you create a minimal project on your github that if I run it with my tokens I get your error.

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