moko-resources icon indicating copy to clipboard operation
moko-resources copied to clipboard

Xcode code completion issue with copyFrameworkResourcesToApp and cocoapods with pod dependencies

Open peterfromearth opened this issue 2 years ago • 1 comments

we use org.jetbrains.kotlin.native.cocoapods plugin

with the following config

cocoapods {
  framework {
    isStatic = true
  }
}

and in xcode

"$SRCROOT/../gradlew" -p "$SRCROOT/../" :shared:copyFrameworkResourcesToApp \
    -Pmoko.resources.PLATFORM_NAME=$PLATFORM_NAME \
    -Pmoko.resources.CONFIGURATION=$CONFIGURATION \
    -Pmoko.resources.BUILT_PRODUCTS_DIR=$BUILT_PRODUCTS_DIR \
    -Pmoko.resources.CONTENTS_FOLDER_PATH=$CONTENTS_FOLDER_PATH\
    -Pkotlin.native.cocoapods.platform=$PLATFORM_NAME \
    -Pkotlin.native.cocoapods.archs="$ARCHS" \
    -Pkotlin.native.cocoapods.configuration=$CONFIGURATION 

as soon as we add a pod dependency (e.g. pod("nanopb")) the code completion in xcode for the shared lib does not work anymore

if we build without the shared:copyFrameworkResourcesToApp the code completion works.

I could see that during the build the file project/shared.bundle in the folder build/cocoapods/framework/shared.framework is like 20MB large. But after the task shared:copyFrameworkResourcesToApp its only 6 KB anymore.

peterfromearth avatar Oct 04 '22 11:10 peterfromearth

Hi @Alex009, I've made a minimal project to reproduce this issue: https://github.com/Ustimov/KMMMR. The problem is that the copyFrameworkResourcesToApp task somehow removes the framework's header file and replaces it with placeholder.h. Do you have any idea how to fix it?

Ustimov avatar Apr 01 '23 06:04 Ustimov

will be fixed in 0.24.0, please check in 0.24.0-alpha-6

ExNDY avatar Apr 17 '24 05:04 ExNDY

fixed in 0.24.0-beta-1

Alex009 avatar Apr 19 '24 15:04 Alex009