Anyone who has experienced an issue with Cocoapods...
# ios
p
Anyone who has experienced an issue with Cocoapods? In the attached error, I’m trying to add ‘SQLCipher’, but the same error occurs when I try to sync gradle with Pods like ‘AFNetworking’ or ‘Reachability’, those that are Objective-C pods. This doesn’t occur on my other mac. I’m just wondering if anyone ever experienced this and what steps you did to solve this? Thank you.
m
Hi, we have something very similar, but in our case it seems to be unrelated to Cocoapods, for us it happens with Xcode 13 RC, but did not happen with the previous Beta after we updated to Kotlin 1.5.30:
Copy code
Exception in thread "main" java.lang.Error: /var/folders/r8/cq5z9sk940sbz3kq52q5x4fx11kwqx/T/1091386677463552763.m:1:9: fatal error: could not build module 'SQLCipher'
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:192)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:68)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:14)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:531)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:268)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:76)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:38)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:60)

> Task :cinteropSQLCipherIos FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':cinteropSQLCipherIos'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk-15.0.2.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
p
Interesting. I did have my suspicion that its the Xcode 13 beta that causes the error. I haven’t tried changing it back to Xcode yet since the DMG is very heavy. But I’ll take this opportunity to try it. Thanks for the insights!
To add up, my other mac where it works mainly uses Xcode 12.4, while on this mac where it’s not working has Xcode 13 beta. I’ll post here if it actually gets fixed when I change to Xcode 12.
m
@Pat Teruel we didn't even have to go back to Xcode 12, even the previous Xcode 13 Beta 5 worked, and Xcode 13 RC doesn't work. So the issue must have happened in the last 4 weeks of Apple's change in Xcode.
BTW, to make it work in Xcode 13 Beta 5 we had to update to Kotlin 1.5.30. With 1.5.20 we were getting this same error even in Beta 5.
👀 1
You can try with Beta 5: https://xcodereleases.com/
p
I am using Beta 5. But I didn’t pay attention to the kotlin version. I’ll try again. Thanks
👍 1
m
@Pat Teruel I think Kotlin 1.5.30 will fix the issue for you with Beta 5, but as soon as you move to RC (and probably the final release build on Monday), it would break again. At least that's our experience right now.
p
If you don’t mind me asking, is there a specific JDK version that I use for this kotlin version? Thank you.
m
I think with Gradle 7 you have to use JDK 11
Which is what you need for the latest Android Gradle Plugin
But I don't remember that Kotlin 1.5.30 in itself changes the minimum requirement to JDK 11
p
I think I’m getting different errors now. I forgot how it was setup, but I can’t seem to run
pod gen
. I forgot what I needed to setup. I’ve been trying the instructions to install
cocoapods-generate
Copy code
$ sudo gem install cocoapods-generate
https://kotlinlang.org/docs/native-cocoapods.html#install-the-cocoapods-dependency-manager-and-plugin I can’t seem to setup the bundler too
m
@Pat Teruel sorry, we don't use
cocoapods-generate
. BTW are you now using Xcode 13 Beta 5 or RC? In any case, if the issue about cinterop persists for you, I think this ticket describes it in JetBrains' issue tracker: https://youtrack.jetbrains.com/issue/KT-48807 Can't hurt to give it a thumbs up and let them know it's important.
p
@matej Thank you for these helpful replies. If I may ask a question, what do you mean by not using
cocoapods-generate
? It’s in the document and I’m not sure why it’s necessary. https://kotlinlang.org/docs/native-cocoapods.html#install-the-cocoapods-dependency-manager-and-plugin
And I literally can’t proceed with the gradle build because of an error with
:shared:podGenIOS
@matej Nevermind. I can now proceed with pod gen. Though the instructions just don’t work, I had to find an alternative way.
m
@Pat Teruel hey sorry for not replying sooner, but maybe you can check the workaround by Sergey Bogolepov here: https://youtrack.jetbrains.com/issue/KT-48807
👍 1
p
@matej thanks. I’m still currently using the beta 5.
Anyway I was able to make it work already. Thank you for all your help!
m
@Pat Teruel the final Xcode 13 release is now available too. Happy to hear you've managed to solve your issue.
👍 1