I wanted the user to be able to edit the parameters in case they needed the .google, so I am using tinyDB so they can change it.
Here is what happens when I try to install an app on an LG running 7.0:
Legacy works exactly as it should, opening the package installer without any errors, which means that the code must be working.
Google Play build returns the error "the_apk's_file_location_here exposed beyond app through Intent.getData()"
However, I haven't built the legacy apk for the app for a while, because I haven't done any updates, so maybe the problem could be because of an update to app inventor.
Would changing the data type property help?
EDIT: I noticed that I had added the .google in the activity package value if not found. I removed it and updated the image because I don't want the .google in case the device doesn't need it.
I wanted the user to be able to edit the parameters in case they needed the .google, so I am using tinyDB so they can change it.
What you do using the TinyDB directly feeding the ActivityStarter Blocks might be OK. I prefer a global variable populated at screen load from the TinyDB Gets . This TinyDB you call TinyDB2. Do you have several instance of TinyDB?
Here is what happens when I try to install an app on an LG running 7.0:
Legacy works exactly as it should, opening the package installer without any errors, which means that the code must be working.
But you state later you did not try a Build using Legacy. Does this mean your code worked prior to nb170 on your LG 7.0?
Google Play build returns the error "the_apk's_file_location_here exposed beyond app through Intent.getData()"
The DataUri block is what is spawning error message. That is what Evan says needs to be fixed.. He said " prevent sharing of file URIs outside of an application. We are working on updating the SDK 26 build to silently convert file URIs to content URIs . When that is done, you code possibly will work with GooglePlay installed to Andrid 7.0 devices.
You get the file location of the APK you want to install from another Screen. The need to capture data from another Screen might introduce a timing issue. You might revise the order of assigning values to the ActivityStarter. Consider placing the DataUril Block preceding the Action Block. Sometimes, reordering helps.
However, I haven't built the legacy apk for the app for a while, because I haven't done any updates, so maybe the problem could be because of an update to app inventor.
Maybe, you should be using Companion 2.47 and nb170
Would changing the type property help?
It is not possible to see what Data Type you are using from your Blocks. What data type are you using? You can supposedly try any of these:
audio/mpeg4-generic
text/html
audio/mpeg
audio/aac
audio/wav
audio/ogg
audio/midi
audio/x-ms-wma
video/mp4
video/x-msvideo
video/x-ms-wmv
image/png
image/jpeg
image/gif
.xml ->text/xml
.txt -> text/plain
.cfg -> text/plain
.csv -> text/plain
.conf -> text/plain
.rc -> text/plain
.htm -> text/html
.html -> text/html
.pdf -> application/pdf
.apk -> application/vnd.android.package-archive
When capturing string blocks, what is inside them is truncated (as in your image). Is this the string that links into the ActivityStarter.ActivityClass : com.google.android.packageinstaller.PackageInstallerActivity or do you something else?
You might Build this again using the Legacy Build, install the apk and tells us whether your code does what you expect.. just to confirm that both Legacy and GooglePlay builds fail on your 7.0 device.
Also, you might provide here in the an example aia without using the TinyDB of the ActivityStarter code with the AS links hard coded. Only then can MIT or anyone else test this on their 7.0 and other operating systems.
That is the same error I get from using the legacy build on that device.
I am pretty sure this error is a permission problem because the first line of the error message is "Permission Denial".
Thank you for the fix, but the URI problem seems to be unrelated. What I think is that the URI error canceled the activity before the permission error could appear.
Thanks,
John
startActivity(new Intent(android.provider.Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES));
Sounds good. At least one of us knows what to do from here.
John