Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a post_install script to the KMP docs to work around a possible compilation error #575

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions code_blocks/getting-started/installation/kmp_8.ruby
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
target 'iosApp' do
use_frameworks!
platform :ios, '16.0'
pod 'shared', :path => '../shared', :platforms => :ios

# Add the following post_install script:
post_install do |installer|
installer.pods_project.targets.each do |target|
if target.name == 'shared'
target.build_configurations.each do |config|
config.build_settings.delete('ASSETCATALOG_COMPILER_APPICON_NAME')
end
end
end
end
end
10 changes: 10 additions & 0 deletions docs/getting-started/installation/kotlin-multiplatform.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ import cocoapodsGradle from "!!raw-loader!@site/code_blocks/getting-started/inst
{ type: 'kotlin', content: cocoapodsGradle, name: 'build.gradle.kts' }
]} />

Finally, add the following `post_install` script to your iOS app target in your `Podfile`. For instance, if your Kotlin Multiplatform module is named `shared`, it should look something like this:

import podfilePostInstallContent from "!!raw-loader!@site/code_blocks/getting-started/installation/kmp_8.ruby";

<RCCodeBlock tabs={[
{ type: 'ruby', content: podfilePostInstallContent, name: 'Podfile' }
]} />

This avoids the compiler looking for an app icon in your Kotlin Multiplatform module.

### Set the correct launchMode for Android

Depending on your user's payment method, they may be asked by Google Play to verify their purchase in their (banking) app. This means they will have to background your app and go to another app to verify the purchase. If your Activity's `launchMode` is set to anything other than `standard` or `singleTop`, backgrounding your app can cause the purchase to get cancelled. To avoid this, set the `launchMode` of your Activity to `standard` or `singleTop` in your Android app's `AndroidManifest.xml` file:
Expand Down