PDF read error after buiding apk

companion working perfect but after building and installing .apk it is showing
RUNTIME ERROR file:///android_asset/testm.pdf exposed beyond app through Intent.getDara()

companion path : file:///mnt/sdcard/AppInventor/assets/testm.pdf
.apk path : file:///android_asset/testm.pdf

plz help.

  • You can’t use file:// uri since Android Nougat.
  • Try copying file to internal storage.
1 Like

It would really help if you provided a screenshot of your relevant blocks, so we can see what you are trying to do, and where the problem may be.

To get an image of your blocks, right click in the Blocks Editor and select “Download Blocks as Image”. You might want to use an image editor to crop etc. if required. Then post it here in the community.

Taifun


Trying to push the limits! Snippets, Tutorials and Extensions from Pura Vida Apps by Taifun.

1 Like

pdf uploaded as a image than how to read it?
path to call from webviewer?

blocks

trying to read testm.pdf uploaded as a Media file

another app which was started started using the activity starter is not able to read a pdf file stored as asset inside your app, therefore you first have to copy it to the internal sdcard and read it from there
see also How to view a pdf document

Taifun

what is the path of media file after .apk build?

i mean how can i store pdf files in everyones android. basically i have to upload pdf in .apk file only as a media/asset than how to access it?

copy it from the assets to the internal sdcard
try the Copy method from the file extension
https://puravidaapps.com/file.php

Taifun

can you pls give code/blocks for the same in my case?

what about reading the documentation below the Copy block there?

see also tip 2 here App Inventor: How to Learn | Pura Vida Apps

Taifun

:pray: :pray: :pray:thank YOU

companion path : file:///mnt/sdcard/AppInventor/assets/testm.pdf is working fine but .apk path : file:///android_asset/testm.pdf is not working.

plz help

as already said earlier

another app which was started started using the activity starter is not able to read a pdf file stored as asset inside your app, therefore you first have to copy it to the internal sdcard and read it from there
see also How to view a pdf document

Taifun

1 Like

Sir, i read that but m confused what to do now?
whether to make new directory and read from there—> after app install ll it work?

Also Campanion path working fine thats why i get confused

therefore you first have to copy it to the internal sdcard and read it from there

what about trying it?

Taifun

companion path : file:///mnt/sdcard/AppInventor/assets/testm.pdf is working fine but .apk path : file:///android_asset/testm.pdf is not working.

plz help

This path works only for webViewer.