After enabling download of apps to internal storage, it should be installable.
A toast come out and say could not be installed, with the following error logs
04-13 00:35:32.334 2280 6451 I DictionaryProvider:UpdateHandler: downloadFinished() : DownloadId = -696006506
04-13 00:35:32.348 3199 5458 E DatabaseUtils: Writing exception to parcel
04-13 00:35:32.348 3199 5458 E DatabaseUtils: java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/my_downloads from pid=2280, uid=10069 requires android.permission.INTERNET, or grantUriPermission()
04-13 00:35:32.348 3199 5458 E DatabaseUtils: at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:608)
04-13 00:35:32.348 3199 5458 E DatabaseUtils: at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:483)
04-13 00:35:32.348 3199 5458 E DatabaseUtils: at android.content.ContentProvider$Transport.query(ContentProvider.java:212)
04-13 00:35:32.348 3199 5458 E DatabaseUtils: at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
04-13 00:35:32.348 3199 5458 E DatabaseUtils: at android.os.Binder.execTransact(Binder.java:565)
kiwi (Huawei Honor 5x), Lineage 4 Microg 14.1
Have you granted yalp privileges to access storage?
Yes.
What is the download directory in yalp settings set to?
It is set to internal storage. i.e. not on the sdcard but in the private storage of the app itself.
What is the actual string?
/storage/emulated/0/Download
Can the native file manager for that rom access the downloaded file using the exact same path? (There are other paths to the same location such as /storage/self/primary)
/storage/emulated/0/Download
This is external storage path.
The log messages you provided do not come from Yalp Store. Your logs mention lack of INTERNET permission which Yalp Store has. Yalp Store has no classes called DictionaryProvider, UpdateHandler or DatabaseUtils. Seems like a DownloadManager error, but it is not used when downloading to internal storage.
Are you sure you enabled internal storage downloads in Yalp Store settings? Please reproduce the problem and use Yalp Store's built-in error reporter; mention this issue so that I would know it is you.
@yeriomin You are definitely confusing internal vs external storage definitions. External is, for example, a removable SD card, while Internal is the storage space already in the phone. The new option in Settings is mislabeled as well. I already tried to explain this in #386 but you haven't answered. I could say you are right if I look from the app perspective: internal for files inside app's own /data folder and external for every other place; but, this is wrong when we generally talk about file management in a phone...
As of today, YalpStore still can't download to removable SD cards.
Indeed, on my device the last quoted location is internal storage

@Rikk @JonnyTech
You are definitely confusing internal vs external storage definitions.
No, I am not. I understand why there is a confusion - according to Android docs:
All Android devices have two file storage areas: "internal" and "external" storage. These names come from the early days of Android, when most devices offered built-in non-volatile memory (internal storage), plus a removable storage medium such as a micro SD card (external storage). Many devices now divide the permanent storage space into separate "internal" and "external" partitions. So even without a removable storage medium, these two storage spaces always exist, and the API behavior is the same regardless of whether the external storage is removable.
So "external" does not mean that it is a removable SD card. It means public storage accessible to user and other apps, not its physical implementation.
Did you notice there is a word "emulated" in the path /storage/emulated/0/Download? What do you think is emulated exactly? It means external storage emulated by internal storage
@yeriomin why all file managers call it internal?
I would say 'emulated' is a convention oems use to indicate this mount place. /storage/emulated/... is not the real path of the block devices that are mounted there.
This Google definition that "external" is a place "accessible by user" doesn't make much sense to me, because every place is accessible with the proper permissions (root).
It would be a good research someone talking about this difference in concepts.
Edit: after reading more of this Android docs my conclusion is that it 1) Makes sense from the perspective of apps and developers; 2) Is more likely a terminology that makes no sense to end-users but Google wants to impose on people; 3) Considering Android also use the path /sdcard for its 'external-(internal in truth) storage' which is not a real SD card, I would risk saying it is a legacy terminology from early Android versions when phones might have had real SD cards internally; 4) Is is bad and slow at fixing things that make little sense.
Also, I don't get what you mean by "external emulated by internal". Are there two different nand chips? Moreover, something emulated is, for example, a piece of software made for one platform that is being tricked to run in a non-native environment, eg, DOS emulated by QEMU running inside Windows, or a Nintendo game running inside a emulator on PC.
@yeriomin All above out, and sorry for the off-topic, my question really is: Are you going to support downloading to removable external SD cards?
@Rikk
I would say
doesn't make much sense to me
It is not a matter of opinion. The docs clearly state which is which.
Also, I don't get what you mean by "external emulated by internal".
From wikipedia:
Emulation - imitation of behavior of a computer or other electronic system with the help of another type of computer/system
Many android devices don't have an SD card slot at all. The need for a shared user-accessible storage for generic files has not disappeared though. Every android device has some kind of external storage. For old devices it is most likely an SD card. For new devices it is either just the internal storage which emulates externals storage (emulated storage) or emulated storage + SD card. Emulated because it has the function of the external storage, but is backed by something physically inseparable from the device.
Are there two different nand chips?
Two logical volumes on one physical device. It could be an HDD. Android does not care.
Same problem here:

Storage permissions have been granted: 
@conrad-heimbold
installing the app fails
How exactly does it fail? Like I said, @shuhaowu's logs are not from Yalp Store. Please reproduce the problem and post the logs here or use Yalp Store's feedback tool (mention your name and/or this issue number because the reports are anonymous by default).
Storage permissions have been granted
This is irrelevant, that permission is for external storage. Using internal storage requires no permission at all.
I finally got a logcat:
**DatabaseUtils**
Writing exception to parcel
java.lang.SecurityException: Permission Denial: reading com.android.providers.downloads.DownloadProvider uri content://downloads/my_downloads from pid=5059, uid=10064 requires android.permission.INTERNET, or grantUriPermission()
at android.content.ContentProvider.enforceReadPermissionInner(ContentProvider.java:608)
at android.content.ContentProvider$Transport.enforceReadPermission(ContentProvider.java:483)
at android.content.ContentProvider$Transport.query(ContentProvider.java:212)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:112)
at android.os.Binder.execTransact(Binder.java:565)
Now I know, how to fix this problem: I just have to execute adb pm grant com.github.yeriomin.yalpstore android.permission.INTERNET
Edit: This command didn't work. I got the following error:
Operation not allowed: java.lang.SecurityException: Permission android.permission.INTERNET is not a changeable permission type
@conrad-heimbold That's very strange. android.permission.INTERNET is (and always has been) in Yalp Store's manifest. If it wasn't, no network request would be allowed to happen you wouldn't get to the download part. Also, it is not a dangerous permission, so it does not need to be requested explicitly.
Something might be wrong with your OS. When something as ubiquitous as internet permission is not granted, it usually means some third-party app has done that, or some xposed plugin maybe.
Does your problem happen all the time or downloads partly work? Does reinstalling Yalp Store help?
my OS is LineageOS 15.1 with microg, I don't have xposed or anything like that. Deleting all data from yalpstore in the settings (almost equivalent to reinstalling) doesn't help; I got the error again.
It always fails, no matter what app I choose on google play.
Same happened to me. Fresh LOS install. Yalp Store was installed through OTA. Installing an app through local storage failed so I had to disable it.
edit: first time I have this issue, also first time I install through OTA.
@GustavMarwin
Yalp Store was installed through OTA
This helped me find an issue. I'm not sure if it was the issue @shuhaowu and @conrad-heimbold were talking about...
Please, guys, don't ignore the issue template:
Send developer a bug report using Yalp's built-in crash tool. Please identify yourself - the reports are anonymous by default.