TimOrtel / GRPC-Kotlin-Multiplatform

Gradle Plugin and Library to use GRPC within Kotlin multiplatform code.
Apache License 2.0
79 stars 14 forks source link

KMM iOS Integration #20

Closed zazzaze closed 8 months ago

zazzaze commented 1 year ago

Hi! I'm trying to integrate into my KMM project, however, when starting gradle, the following error occurs

Execution failed for task ':shared:cinteropGRPCClientIosArm64'.
> Could not resolve all files for configuration ':shared:iosArm64GRPCClientCInterop'.
   > Could not find com.github.TimOrtel.GRPC-Kotlin-Multiplatform:grpc-multiplatform-lib-iosarm64:0.3.0.
     Required by:
         project :shared > com.github.TimOrtel.GRPC-Kotlin-Multiplatform:grpc-multiplatform-lib:0.3.0

Please tell me what the problem may be

TimOrtel commented 1 year ago

Currently, the iOS library is not built on jitpack sadly. The easiest workaround is to clone this repository on your local machine and run the publishToMavenLocal task. Then it will work as expected.

Don't forget to add mavenLocal to your repositories.

zazzaze commented 1 year ago

Yeah, thanks a lot, that's how it works! However, when building, I still get this error

While building module 'Foundation' imported from kmm/iosApp/Pods/Target Support Files/Pods-iosApp/Pods-iosApp-dummy.m:1:
While building module 'CoreFoundation' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:6:
While building module 'Darwin' imported from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:16:
While building module 'openssl_grpc' imported from kmm/build/ios/Debug-iphonesimulator/BoringSSL-GRPC/openssl_grpc.framework/Headers/time.h:18:
While building module 'UIKit' imported from kmm/iosApp/Pods/Target Support Files/BoringSSL-GRPC/BoringSSL-GRPC-umbrella.h:2:
In file included from <module-includes>:1:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator16.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h:8:9: fatal error: cyclic dependency in module 'Foundation': Foundation -> CoreFoundation -> Darwin -> openssl_grpc -> UIKit -> Foundation
#import <Foundation/Foundation.h>

Any idea why this is happening?

TimOrtel commented 1 year ago

At first glance this does not look related to this project. Have you already tried kdoctor? https://github.com/Kotlin/kdoctor

TimOrtel commented 8 months ago

The library is now published on maven central.