Skip to content

Commit

Permalink
Adds a post_install script to the KMP docs to work around a possible …
Browse files Browse the repository at this point in the history
…compilation error (#575)
  • Loading branch information
JayShortway authored Dec 24, 2024
1 parent 6925390 commit 2eff7fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
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

0 comments on commit 2eff7fd

Please sign in to comment.