after adding `pod("RevenueCat", "~> 4.15"` to `...
# compose-ios
m
after adding
pod("RevenueCat", "~> 4.15"
to
shared build.gradle.kts
cocoapods
block. app stops running on iOS, iOS app can’t see
shared
module any more
d
You can add it to iosApp/Podfile and use it right in Swift code.
m
ofc. but is there a way to use it in Kotlin code? I get all the code in Kotlin but just can’t run. or that’s not how it’s supposed to be used?
l
Is the project multi-module? I always put the cocoapods block in each module's build.gradle if it needs cocoapods.
m
it’s
build.gradle.kts
from
shared
module
d
Ok, thanks. I will check it.
m
thank you very much
d
I tried to use this library:
Copy code
pod("AFNetworking") {
            version = "~> 4.0.1"
        }
Works fine. Now, I will check your library
Copy code
cocoapods {
        summary = "Shared code for the sample"
        homepage = "<https://github.com/JetBrains/compose-jb>"
        ios.deploymentTarget = "14.1"
        podfile = project.file("../iosApp/Podfile")
        framework {
            baseName = "shared"
            isStatic = true
        }
        extraSpecAttributes["resources"] =
            "['src/commonMain/resources/**', 'src/iosMain/resources/**']"
        pod("AFNetworking") {
            version = "~> 4.0.1"
        }
        pod("RevenueCat") {
            version = "~> 4.15"
        }
    }
Compiles fine
m
I’m trying in new blank project now
but when only change I make is to add pod(“RevenueCat”) app won’t compile, in my original project
🤔
Maybe you need to resync gradle project in AndroidStudio
And run
Copy code
cd iosApp
pod install
m
already tried but I’ll do it again just to be 100% sure
in blank new project it works but as soon as I add
pod("RevenueCat")
to the project I have problems with it stops compiling
and
isStatic = true
causes issues 😄
Copy code
Undefined symbols for architecture arm64:
  "_sqlite3_bind_blob", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_blob_wrapper69 in shared(result.o)
  "_sqlite3_bind_double", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_double_wrapper71 in shared(result.o)
  "_sqlite3_bind_int64", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_int64_wrapper73 in shared(result.o)
  "_sqlite3_bind_null", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_null_wrapper74 in shared(result.o)
  "_sqlite3_bind_parameter_index", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_parameter_index_wrapper84 in shared(result.o)
  "_sqlite3_bind_text", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_bind_text_wrapper75 in shared(result.o)
  "_sqlite3_busy_timeout", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_busy_timeout_wrapper22 in shared(result.o)
  "_sqlite3_changes", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_changes_wrapper16 in shared(result.o)
  "_sqlite3_clear_bindings", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_clear_bindings_wrapper85 in shared(result.o)
  "_sqlite3_close", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_close_wrapper6 in shared(result.o)
  "_sqlite3_close_v2", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_close_v2_wrapper7 in shared(result.o)
  "_sqlite3_column_blob", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_blob_wrapper99 in shared(result.o)
  "_sqlite3_column_bytes", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_bytes_wrapper106 in shared(result.o)
  "_sqlite3_column_count", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_count_wrapper86 in shared(result.o)
  "_sqlite3_column_double", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_double_wrapper100 in shared(result.o)
  "_sqlite3_column_int64", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_int64_wrapper102 in shared(result.o)
  "_sqlite3_column_name", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_name_wrapper87 in shared(result.o)
  "_sqlite3_column_text", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_text_wrapper103 in shared(result.o)
  "_sqlite3_column_type", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_column_type_wrapper108 in shared(result.o)
  "_sqlite3_db_config", referenced from:
      knifunptr_co_touchlab_sqliter_sqlite314_sqlite3_db_config in shared(result.o)
  "_sqlite3_db_readonly", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_db_readonly_wrapper177 in shared(result.o)
  "_sqlite3_errmsg", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_errmsg_wrapper53 in shared(result.o)
  "_sqlite3_finalize", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_finalize_wrapper109 in shared(result.o)
  "_sqlite3_last_insert_rowid", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_last_insert_rowid_wrapper14 in shared(result.o)
  "_sqlite3_open_v2", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_open_v2_wrapper43 in shared(result.o)
  "_sqlite3_prepare16_v2", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_prepare16_v2_wrapper61 in shared(result.o)
  "_sqlite3_reset", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_reset_wrapper110 in shared(result.o)
  "_sqlite3_step", referenced from:
      _co_touchlab_sqliter_sqlite3_sqlite3_step_wrapper97 in shared(result.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
d
Cool, you found a answer
m
I don’t understand 🙂. but then why it works with
isStatic = false
and no
pod
dependency?
and when I add
Copy code
pod("AFNetworking") {
            version = "~> 4.0.1"
        }
it still doesn’t work
d
I found error in a project that I provided: https://github.com/dima-avdeev-jb/ios-slack-question-pods I will fix it soon
m
thank you for your time
btw. I updated to sqldelight 2.0 and
isStatic = true
still causes same error
d
Fixed in sample project. Can you please remove previously cloned directory of a project ios-slack-question-pods Open in AndroidStudio? Choose iosApp in run configuration
m
I’ll try it now
what exactly was the issue? I can’t see anything in commit history
what you posted works
d
It was a small fixes in naming. You can use this sample project to figure out what is wrong with your project.
Or you can try to create a minimal reproducible sample of your project, share it on GitHub and send to us.
m
thanks. I’ll try to fix the project and if I’m unable to I’ll create minimal reproducable sample
but original project simply doesn’t work 😄. I managed to set
isStatic = true
but it didn’t solve the issue. I’ll create reproducable sample
@Dima Avdeev I literally copy pasted everything into new project and it works… do you have any advice how can I find out what’s wrong with my original project?
d
Interesting. I see this points to investigate: • Gradle configuration (check CocoaPods description in shared module, iOS targets in kotlin { } block) • CocoaPods configuration (check directories, pod names) • Xcode project configuration (the hardest point because Xcode has a lot of features to configure build)
m
thank you very much
if anyone if having same issue: I created brand new project, copy/pasted everything and now everything works