TheArchitect123 / KmpEssentials

KmpEssentials is a library that contains apis (40+ Modules) to accelerate your development. Everything from managing the Battery, File System, getting Package information, or taking Photos. Supports iOS, Android & AppleWatch
MIT License
169 stars 2 forks source link

[Google Play Rules] Give ability to include only needed part of the library in the app. #22

Closed Monabr closed 15 hours ago

Monabr commented 3 days ago

Is your feature request related to a problem? Please describe. After uploading build to the Google Play I see warning: All developers requesting access to the photo and video permissions are required to tell Google Play about the core functionality of their app. I don't use this functionality but it still included into the app and Google does not like it.

Describe the solution you'd like Please give the ability to include to the app only that parts that I need.

TheArchitect123 commented 3 days ago

@Monabr

Can you try again with v1.5.4? Tell me if it works now.

Tommyten commented 22 hours ago

While v1.5.4 might fix the problem @Monabr is facing (haven't tested myself), it would be great if you could provide more granular modules. For example if I want to only include Biometric Authentication I would like to be able to only include Biometric Authentication for example by having a maven artifact, that only provides the Biometric authentication. In a build.gradle it could look like this: implementation("io.github.thearchitect123:kmpEssentials-biometric:+")

@Monabr if you're still facing your issue try forcefully excluding the relevant permissions like so:

<uses-permission
        android:name="android.permission.READ_MEDIA_IMAGES"
        tools:node="remove" />
<uses-permission
        android:name="android.permission.READ_MEDIA_VIDEO"
        tools:node="remove" />

In Android Studio you can look at the Merged Manifest. By including the above code block the permissions you remove should not be in the Merged Manifest anymore.

TheArchitect123 commented 15 hours ago

@Tommyten

I appreciate your input on this but merge manifest rules are not going to fix this issue.

@Monabr Please download the latest version (as of now it is v1.5.7) And this will resolve your issue.

To replicate this problem I deployed a sample app on Google Play Internal Channel using v.1.5.4. And I got 12 declaration requirements (including the Photos + Videos).

Screenshot 2024-11-16 at 1 53 23 am Screenshot 2024-11-16 at 1 54 35 am




Then when I redeployed a new version of the sample app with v1.5.7 of KmpEssentials the declaration requirement was removed.

Screenshot 2024-11-16 at 1 56 50 am




@Tommyten Yes, I'm planning to provide a better modularising architecture. So developers only import the modules they need. It will look something like this (when you initialize the library),

Inside your shared code you would write

KmpEssentials.loadModules(
   useBiometric = false,
   useFilePicker = false
)

Default value is true (meaning all modules are loaded), and false you can configure to disable those modules from being imported.

And also I appreciate the feedback. Thank you for reporting issues and providing suggestions. If you have any feature requests don't hesitate to ask.

:)