Has anyone encountered an issue where you can buil...
# multiplatform
k
Has anyone encountered an issue where you can build through Android Studio but not on Xcode? AS builds fine when running
cinterop
via cocoapods but on Xcode it doesn’t. Also, when checking on
build/cocoapods/synthetic
, the Pods are in there! On Xcode we get this error:
Copy code
> Task :shared:firebase:auth:cinteropFirebaseAuthIos FAILED
Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/3409687098729027093.m:1:9: fatal error: module 'FirebaseAuth' not found
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
	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:515)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
	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)
:shared:firebase:auth:cinteropFirebaseAuthIos (Thread[Execution worker for ':' Thread 3,5,main]) completed. Took 6.607 secs.
v
m
@Viacheslav Kormushkin thanks for the suggestion, but it looks like this person's issue was that they were using the wrong pod name right from the start,
Firebase/Auth
instead of
FirebaseAuth
. I don't think it's the same error as ours, we use
SQLCipher
from the beginning, and it used to work with Xcode 13 Beta 5 (4 weeks old) and now doesn't anymore with Xcode 13 RC (2 days ago).
k
Thanks for your responses. We’re actually using
FirebaseAuth
for the pod
I can also build it on my machine and my co-worker cant but just for Xcode. It’s really making us scratch our heads
m
@Kurt Renzo Acosta are you and your coworker using the same version of Xcode?
k
Yup 12.5.1
Same version for everything. • Xcode - 12.5.1 • AS - Arctic Fox 2020.3.1 Patch 2 • openjdk - 11.0.10 • cocoapods - 1.10.0 • cocoapods-generate - 2.2.2
👍 1
m
Highly likely then that our issues are not the same
v
yeah, these issues seem to be different… @Kurt Renzo Acosta please verify the following: 1. compare your and coworker’s podspec files 2. try run ‘pod install’ manually on coworkers machine 3. compare script build phases in the Xcode project for shared module target
@matej, cinterop breakages were reported for earlier Xcode 13 beta release (https://youtrack.jetbrains.com/issue/KT-47935) and the hotfix has been provided along with 1.5.30 release. It is quite possible that RC has brought some new issues.
👍 1
m
@Viacheslav Kormushkin it looks to me like this ticket is the same issue: https://youtrack.jetbrains.com/issue/KT-48807 The priority has been set to Critical, but I'm a little worried about the target being
1.6.0-RC
... No idea how far off that is, and iOS 15 launches today.
v
Correct, this ticket is for this problem specifically. Unfortunately, 1.6.0 is the closest Kotlin release, so not sure whether a hot fix can be provided earlier.
m
@Viacheslav Kormushkin thank you very much for the info nonetheless. I appreciate what you guys and gals are doing!
🙏 1
k
Thanks @Viacheslav Kormushkin i just saw this now. I’ll let my coworker try and let you know
@Viacheslav Kormushkin everything’s the same on both our ends
our kt version is also 1.5.21 and we’re not using xcode 13
v
Calling ‘pod install’ also did not help? I’m afraid I don’t have any good idea as of now=( Normally when building from Xcode a syncFramework task is getting called, which in turn calls a suitable building task and then copies artifacts to the right place. So there should not be much difference between building from Xcode, AS or terminal. Please try to edit script phase of cocoapod target in Xcode and add --info key to the gradlew invocation, then build and share the build log, probably we may find something there
m
BTW, Sergey Bogolepov posted a workaround on a ticket that affected us: https://youtrack.jetbrains.com/issue/KT-48807 Not sure if it helps you, but it solved our problem.
k
Copy code
Task :shared:firebase:storage:cinteropFirebaseStorageIos
Custom actions are attached to task ':shared:firebase:storage:cinteropFirebaseStorageIos'.
Build cache key for task ':shared:firebase:storage:cinteropFirebaseStorageIos' is cab97058784a688029b2072bb833a4eb
Task ':shared:firebase:storage:cinteropFirebaseStorageIos' is not up-to-date because:
Value of input property 'compilerOpts' has changed for task ':shared:firebase:storage:cinteropFirebaseStorageIos'
Run "cinterop" tool in a separate JVM process
Main class = org.jetbrains.kotlin.cli.utilities.MainKt
Arguments = [
-o
/Users/macosuser/project/kmm-app/shared/firebase/storage/build/classes/kotlin/ios/main/cinterop/storage-cinterop-FirebaseStorage.klib
-target
ios_x64
-def
/Users/macosuser/project/kmm-app/shared/firebase/storage/build/cocoapods/defs/FirebaseStorage.def
-pkg
cocoapods.FirebaseStorage
-compiler-option
-F/Users/macosuser/project/kmm-app/ios/Pods/../../shared/ios/build/cocoapods/framework
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.5.0-native-mt/64a9fb4ffa155ab3064da1569e62148fabb8be4f/kotlinx-coroutines-core.klib
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/467490b17262e30ba79697e2d771ff960e76f9cc/atomicfu.klib
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/5fd3455e72c3029961249259c93ab4c820fc2ce0/atomicfu-cinterop-interop.klib
-Xmodule-name
KMM.shared.firebase:storage-cinterop-FirebaseStorage
]
Transformed arguments = [
cinterop
-o
/Users/macosuser/project/kmm-app/shared/firebase/storage/build/classes/kotlin/ios/main/cinterop/storage-cinterop-FirebaseStorage.klib
-target
ios_x64
-def
/Users/macosuser/project/kmm-app/shared/firebase/storage/build/cocoapods/defs/FirebaseStorage.def
-pkg
cocoapods.FirebaseStorage
-compiler-option
-F/Users/macosuser/project/kmm-app/ios/Pods/../../shared/ios/build/cocoapods/framework
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.5.0-native-mt/64a9fb4ffa155ab3064da1569e62148fabb8be4f/kotlinx-coroutines-core.klib
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/467490b17262e30ba79697e2d771ff960e76f9cc/atomicfu.klib
-library
/Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/5fd3455e72c3029961249259c93ab4c820fc2ce0/atomicfu-cinterop-interop.klib
-Xmodule-name
KMM.shared.firebase:storage-cinterop-FirebaseStorage
]
Classpath = [
/Users/macosuser/.konan/kotlin-native-prebuilt-macos-1.5.21/konan/lib/trove4j.jar
/Users/macosuser/.konan/kotlin-native-prebuilt-macos-1.5.21/konan/lib/kotlin-native.jar
]
JVM options = [
-ea
-Xmx3G
]
Java system properties = [
gopherProxySet = false
awt.toolkit = sun.lwawt.macosx.LWCToolkit
idea.io.use.nio2 = true
java.specification.version = 11
sun.cpu.isalist = ""
sun.jnu.encoding = UTF-8
java.class.path = /Users/macosuser/.gradle/wrapper/dists/gradle-7.0.2-all/7era6s5ay7zsbhuvl0oc9g94s/gradle-7.0.2/lib/gradle-launcher-7.0.2.jar
java.vm.vendor = AdoptOpenJDK
sun.arch.data.model = 64
user.variant = ""
java.vendor.url = <https://adoptopenjdk.net/>
user.timezone = ""
psi.track.invalidation = true
idea.ignore.disabled.plugins = true
os.name = "Mac OS X"
java.vm.specification.version = 11
user.country = SG
sun.java.launcher = SUN_STANDARD
sun.boot.library.path = /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/lib
sun.java.command = "org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.0.2"
http.nonProxyHosts = local|*.local|169.254/16|*.169.254/16
jdk.debug = release
sun.cpu.endian = little
user.home = /Users/macosuser
user.language = en
org.gradle.appname = gradlew
java.specification.vendor = "Oracle Corporation"
java.version.date = 2021-04-20
java.home = /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
idea.plugins.compatible.build = 201.6668.13
file.separator = /
java.vm.compressedOopsMode = "Zero based"
line.separator = "\n"
java.specification.name = "Java Platform API Specification"
java.vm.specification.vendor = "Oracle Corporation"
java.awt.graphicsenv = sun.awt.CGraphicsEnvironment
java.awt.headless = true
idea.home.path = /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/
sun.management.compiler = "HotSpot 64-Bit Tiered Compilers"
ftp.nonProxyHosts = local|*.local|169.254/16|*.169.254/16
java.runtime.version = 11.0.11+9
user.name = macosuser
path.separator = :
os.version = 11.5
java.runtime.name = "OpenJDK Runtime Environment"
file.encoding = UTF-8
project.structure.add.tools.jar.to.new.jdk = false
psi.incremental.reparse.depth.limit = 1000
java.vm.name = "OpenJDK 64-Bit Server VM"
java.vendor.version = AdoptOpenJDK-11.0.11+9
kotlin.environment.keepalive = true
java.vendor.url.bug = <https://github.com/AdoptOpenJDK/openjdk-support/issues>
java.io.tmpdir = /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/
java.version = 11.0.11
ide.hide.excluded.files = false
os.arch = x86_64
java.vm.specification.name = "Java Virtual Machine Specification"
java.awt.printerjob = sun.lwawt.macosx.CPrinterJob
sun.os.patch.level = unknown
kotlin.daemon.jvm.options = --illegal-access=permit
java.library.path = /Users/macosuser/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.
<http://java.vm.info|java.vm.info> = "mixed mode"
java.vendor = AdoptOpenJDK
java.vm.version = 11.0.11+9
sun.io.unicode.encoding = UnicodeBig
library.jansi.path = /Users/macosuser/.gradle/native/jansi/1.18/osx
java.class.version = 55.0
socksNonProxyHosts = local|*.local|169.254/16|*.169.254/16
ast.loading.filter = false
org.jetbrains.kotlin.cliMessageRenderer = GradleStyle
]
Suppressed ENV variables = []
Custom ENV variables = [
LIBCLANG_DISABLE_CRASH_RECOVERY = 1
]
Starting process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java''. Working directory: /Users/macosuser/project/kmm-app/shared/firebase/storage Command: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java -Dast.loading.filter=false -Dawt.toolkit=sun.lwawt.macosx.LWCToolkit -Dfile.separator=/ -Dftp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -DgopherProxySet=false -Dhttp.nonProxyHosts=local|*.local|169.254/16|*.169.254/16 -Dide.hide.excluded.files=false -Didea.home.path=/var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/ -Didea.ignore.disabled.plugins=true -Didea.io.use.nio2=true -Didea.plugins.compatible.build=201.6668.13 -Djava.awt.graphicsenv=sun.awt.CGraphicsEnvironment -Djava.awt.headless=true -Djava.awt.printerjob=sun.lwawt.macosx.CPrinterJob -Djava.class.path=/Users/macosuser/.gradle/wrapper/dists/gradle-7.0.2-all/7era6s5ay7zsbhuvl0oc9g94s/gradle-7.0.2/lib/gradle-launcher-7.0.2.jar -Djava.class.version=55.0 -Djava.home=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home -Djava.library.path=/Users/macosuser/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. -Djava.runtime.name=OpenJDK Runtime Environment -Djava.runtime.version=11.0.11+9 -Djava.specification.name=Java Platform API Specification -Djava.specification.vendor=Oracle Corporation -Djava.specification.version=11 -Djava.vendor=AdoptOpenJDK -Djava.vendor.url=<https://adoptopenjdk.net/> -Djava.vendor.url.bug=<https://github.com/AdoptOpenJDK/openjdk-support/issues> -Djava.vendor.version=AdoptOpenJDK-11.0.11+9 -Djava.version=11.0.11 -Djava.version.date=2021-04-20 -Djava.vm.compressedOopsMode=Zero based -<http://Djava.vm.info|Djava.vm.info>=mixed mode -Djava.vm.name=OpenJDK 64-Bit Server VM -Djava.vm.specification.name=Java Virtual Machine Specification -Djava.vm.specification.vendor=Oracle Corporation -Djava.vm.specification.version=11 -Djava.vm.vendor=AdoptOpenJDK -Djava.vm.version=11.0.11+9 -Djdk.debug=release -Dkotlin.daemon.jvm.options=--illegal-access=permit -Dkotlin.environment.keepalive=true -Dlibrary.jansi.path=/Users/macosuser/.gradle/native/jansi/1.18/osx -Dline.separator=
-Dorg.gradle.appname=gradlew -Dorg.jetbrains.kotlin.cliMessageRenderer=GradleStyle -Dos.arch=x86_64 -Dos.name=Mac OS X -Dos.version=11.5 -Dpath.separator=: -Dproject.structure.add.tools.jar.to.new.jdk=false -Dpsi.incremental.reparse.depth.limit=1000 -Dpsi.track.invalidation=true -DsocksNonProxyHosts=local|*.local|169.254/16|*.169.254/16 -Dsun.arch.data.model=64 -Dsun.boot.library.path=/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/lib -Dsun.cpu.endian=little -Dsun.cpu.isalist -Dsun.io.unicode.encoding=UnicodeBig -Dsun.java.command=org.gradle.launcher.daemon.bootstrap.GradleDaemon 7.0.2 -Dsun.java.launcher=SUN_STANDARD -Dsun.jnu.encoding=UTF-8 -Dsun.management.compiler=HotSpot 64-Bit Tiered Compilers -Dsun.os.patch.level=unknown -Duser.home=/Users/macosuser -Duser.name=macosuser -Duser.timezone -Xmx3G -Dfile.encoding=UTF-8 -Djava.io.tmpdir=/var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/ -Duser.country=SG -Duser.language=en -Duser.variant -ea -cp /Users/macosuser/.konan/kotlin-native-prebuilt-macos-1.5.21/konan/lib/trove4j.jar:/Users/macosuser/.konan/kotlin-native-prebuilt-macos-1.5.21/konan/lib/kotlin-native.jar org.jetbrains.kotlin.cli.utilities.MainKt cinterop -o /Users/macosuser/project/kmm-app/shared/firebase/storage/build/classes/kotlin/ios/main/cinterop/storage-cinterop-FirebaseStorage.klib -target ios_x64 -def /Users/macosuser/project/kmm-app/shared/firebase/storage/build/cocoapods/defs/FirebaseStorage.def -pkg cocoapods.FirebaseStorage -compiler-option -F/Users/macosuser/project/kmm-app/ios/Pods/../../shared/ios/build/cocoapods/framework -library /Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/kotlinx-coroutines-core-iosx64/1.5.0-native-mt/64a9fb4ffa155ab3064da1569e62148fabb8be4f/kotlinx-coroutines-core.klib -library /Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/467490b17262e30ba79697e2d771ff960e76f9cc/atomicfu.klib -library /Users/macosuser/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlinx/atomicfu-iosx64/0.16.1/5fd3455e72c3029961249259c93ab4c820fc2ce0/atomicfu-cinterop-interop.klib -Xmodule-name KMM.shared.firebase:storage-cinterop-FirebaseStorage
Successfully started process 'command '/Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home/bin/java''
Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/12335262575155753722.m:1:9: fatal error: module 'FirebaseStorage' not found
at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:152)
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:515)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:266)
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)
Thanks @matej but it doesn’t seem to be the solution for us. @Viacheslav Kormushkin i’ve pasted an info log above im not quite sure how to interpret it
n
Hey @Kurt Renzo Acosta, I’m running into the same issue with Firebase pods right now. Did you finally found a solution?
k
Yes. In our case we just missed some lines with our pods
👀 1
Also make sure that you’re using
pod("FirebaseAuth")
or
pod("Firebase/Auth") { moduleName = "FirebaseAuth" }
instead of
pod("Firebase/Auth")
. You can change Auth for any other Firebase module like Storage or Messaging. Hope that helps
n
Thank you for the info, man. You had the same exact issue than me about the modularised app. I didn’t achieve the solution yet, but I feel I’m closer.