Android Question Problem with FileProvider and PermissionsManager (Ivica Golubovic)

musaso

Active Member
Licensed User
When updating B4X to version 12.50 I get an error in the log (FileProvider is declared twice. You must remove the reference to the library or the code module.). I have tried with a new project and simply by selecting the 2 libraries I get this message.

Sin título2.JPG
 

musaso

Active Member
Licensed User
1. This library mistakenly includes a copy of FileProvider.
2. It is not needed. You should use RuntimePermissions instead.
3. Removing FileProvider library will also work.

1. This library mistakenly includes a copy of FileProvider.
2. It is not needed. You should use RuntimePermissions instead.
3. Removing FileProvider library will also work.
okay, thanks.
 
Upvote 0

Ivica Golubovic

Active Member
Licensed User
Only uncheck FileProvider librarry and leave PermissionsManager. PermissionsManager contains FileProvider class which save 0.5MB on the app size. So if you use PermissionsManager then do not use FileProvider library.

To be clear, if you use native B4X file provider you will get 500KB bigger apk size.
 
Last edited:
Upvote 0

musaso

Active Member
Licensed User
Only uncheck FileProvider librarry and leave PermissionsManager. PermissionsManager contains FileProvider class which save 0.5MB on the app size. So if you use PermissionsManager then do not use FileProvider library.

To be clear, if you use native B4X file provider you will get 500KB bigger apk size.
only with PermissionsManager selected gives me the same error

Sin título2.JPG


error.JPG
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
only with PermissionsManager selected gives me the same error
it is still in the wrong path!

Permissionmanagaer is not a internal library and should NOT be placed in the internal library folder.
Instead you shout put all Additional libraries in the additional library folder.
 
Upvote 0

musaso

Active Member
Licensed User
it is still in the wrong path!

Permissionmanagaer is not a internal library and should NOT be placed in the internal library folder.
Instead you shout put all Additional libraries in the additional library folder.
ok, sorry for my mistake. thank you
 
Upvote 0

Ivica Golubovic

Active Member
Licensed User
This is a complete waste of time.
As I wrote FileProvider is 20 lines of code.

The 500kb increase in size comes from androidx.core:core that is a dependency of RuntimePermissions (which FileProvider depends on). Any real app will include these dependencies anyway.
Yes, file provider class is wrapped from package and save 500KB. There is large number of apps which did not require androidx.core package. I have several of this apps. So if any app did not reqiure whole package it is a waste of space to use 20 lines of code and add whole package of 500KB for the file provider only. That is my logic.

Visit this link on B4X forum site:
Thread 'How to get FileProvider working without entire RuntimePermission lib or entire com.android.support:support-v4 ?' https://www.b4x.com/android/forum/t...entire-com-android-support-support-v4.145260/
 
Upvote 0
Top