Hi, when trying to upload a build to the playstore...
# koin
a
Hi, when trying to upload a build to the playstore with koin-bom = "4.1.0-Beta8" I am getting
Your APK or Android App Bundle is using permissions that require a privacy policy: (android.permission.READ_PHONE_STATE).
😮 1
🤔 1
1
Copy code
reason: org.koin.compose.viewmodel has a targetSdkVersion < 4
uses-permission#android.permission.READ_PHONE_STATE
a
no trace of
android.permission.READ_PHONE_STATE
anywhere
targetSdkVersion < 4
clearly weird
a
Copy code
IMPLIED from /Users/arsildo/AndroidStudioProjects/best-technicians/composeApp/src/androidMain/AndroidManifest.xml:2:1-61:12 reason: org.koin.compose.viewmodel has a targetSdkVersion < 4
uses-permission#android.permission.READ_PHONE_STATE
IMPLIED from /Users/arsildo/AndroidStudioProjects/best-technicians/composeApp/src/androidMain/AndroidManifest.xml:2:1-61:12 reason: org.koin.compose.viewmodel has a targetSdkVersion < 4
uses-permission#android.permission.READ_EXTERNAL_STORAGE
IMPLIED from /Users/arsildo/AndroidStudioProjects/best-technicians/composeApp/src/androidMain/AndroidManifest.xml:2:1-61:12 reason: org.koin.compose.viewmodel requested WRITE_EXTERNAL_STORAGE
READ_PHONE_STATE, READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE
a
what about the beta
koin-bom = "4.1.0-Beta8" or no changes here
a
4.1.0-Beta8 is last beta outside
a
100% something added in beta8
when i build with beta7 it is ok
no issues
a
Compose upgrade
z
I think this was me: https://github.com/InsertKoinIO/koin/pull/2179
I'm not sure why the Android target wasn't added to those KMP libraries before - please review if those changes make sense or not
Probably missed adding an explicit target SDK and something weird happens when you leave it as a default
Certainly didn't change permissions or anything, just messed up the SDK versions implicitly somehow
I believe this is the fix, minSdk wasn't set on two of the three modules newly configured with an Android target: https://github.com/InsertKoinIO/koin/pull/2192
I remain a little unsure about whether the Android targets are needed for these libraries, apparently only 6 of Koin's modules are configured this way, and the rest are just publishing as JVM libraries and that's what Android users are pulling in
I added these for the modules that use CMP so that Android can still compile with a Java 1.8 target for better compatibility, while using Java 11 target for desktop as CMP requires it
But I'll leave it to the core Koin folks to figure out what's right for their project 😄
In the meantime, for anyone running into this, you can add this to your manifest to not get these permissions merged into it:
Copy code
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE" tools:node="remove"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" tools:node="remove"/>
👍 1
a
z
I don't know, I didn't investigate that far. But it only happens if the minsdk is unset. Maybe AGP adds defaults to something like minSdk 1 and automatically adds these in that case, but it's a complete guess.
a
yep 👍
between Beta7 and after, there is a new stuff that provokes this manifest merge I'm on it
else Beta10 brings fixed minSdk levels
m
dependabot is trying to update our beta version with these newer changes and it seems like there’s an issue with duplicate classes since we now have
koin-core-annotations
in addition to (our explicit)
koin-annotations
… beta8 did not have these newer transitive dependencies
(android project; the bundle task has a checkDuplicateClasses task that fails)
z
@arnaud.giuliani Beta11 isn't on the list of releases btw https://github.com/InsertKoinIO/koin/releases
a
I think it is a typo, he meant beta 10
z
There's a Beta11 published, here's the tag and here's some of the artifacts, it's just not added as a GitHub release
👍 1
a
@Matt Thompson you need to wait a patch on Koin Annotations 2.0.1 to help coordinate it with Koin 4.1 - for the 2 extracted annotations
m
okay 👍 - we’re on beta8 but i think we already had those permissions in our manifest, so hopefully we can still release
a
Yes, I will adjust quickly in the next days for Koin Annotations 2.0.x to help adjust with Koin 4.1 annotations artifact
I will begin to clean all to prepare Koin 4.1 RC. Just waiting for some Ktor 3.2 DI integration work