OK, first off I know this is not a B4A error and is android related; that said I do need to understand what is going wrong before I hand out any new Android 10 devices.
I have an app that checks for newer versions of itself by comparing the package version with the latest version via a web server, it then downloads the new apk and starts the install intent.
This works on all devices I have tried except this new one which is probably the only one I have running Android 10.
The app has permissions to install and the download seems to work OK but the install itself always comes up with the dreaded 'There was a problem while parsing the package.' message.
The existing app was compiled and installed from the same machine as the new apk version so has the same signature and package name.
Below is the install intent code (sdkVersion is > 24) which works on all other devices I have tried.
Has anyone got any idea what else could be causing the error?
Thanks
Nibbo
I have an app that checks for newer versions of itself by comparing the package version with the latest version via a web server, it then downloads the new apk and starts the install intent.
This works on all devices I have tried except this new one which is probably the only one I have running Android 10.
The app has permissions to install and the download seems to work OK but the install itself always comes up with the dreaded 'There was a problem while parsing the package.' message.
The existing app was compiled and installed from the same machine as the new apk version so has the same signature and package name.
Below is the install intent code (sdkVersion is > 24) which works on all other devices I have tried.
B4X:
ProgressDialogShow("Installing...")
Dim i As Intent
If phone.SdkVersion >= 24 Then
i.Initialize("android.intent.action.INSTALL_PACKAGE", "content://" & File.Combine(File.DirInternalCache, "MyApp.apk"))
i.Flags = Bit.Or(i.Flags, 1) 'FLAG_GRANT_READ_URI_PERMISSION
Else
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(File.DirInternalCache, "MyApp.apk"))
i.SetType("application/vnd.android.package-archive")
End If
StartActivity(i)
Has anyone got any idea what else could be causing the error?
Thanks
Nibbo