Add libsqlite3.0 into a pod project error - ios

I'm creating a pod that needs a static library (AdobeMobileLibrary.a)
This library has a dependency with libsqlite3.0, but adding it and then compiling it shows this error
error:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool:
file:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.0.sdk/usr/lib/libsqlite3.0.tbd
is not an object file (not allowed in a library)
Someone who can help me? Thanks

Related

Importing GoogleWebRTC pod fails: module 'GoogleWebRTC' not found

I am currently working on a Kotlin multiplatform and am trying to interface with the GoogleWebRTC pod.
The pod exists, I was able to import it in a separate project (without Kotlin multiplatform). I can see the .framework is created in my build directory, however when doing a gradle sync or building from Xcode, I get the following error:
Exception in thread "main" java.lang.Error: /var/folders/hv/9cx28nxx4gz9hj_m86bp5rx40000gn/T/tmp362966650322311128.m:1:9: fatal error: module 'GoogleWebRTC' 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:67)
at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:13)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:499)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:264)
at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.interop(main.kt:72)
at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:45)
at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:19)
at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:37)
Execution failed for task ':shared:cinteropGoogleWebRTCIosArm64'.
> Process 'command '/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
AFNetworking seems to work fine, but adding the WebRTC pod seems to break the project.
Am I missing a limitation of Kotlin multiplatform or something?
This is my build.gradle.kts:
cocoapods {
// Configure fields required by CocoaPods.
summary = "Some description for a Kotlin/Native module"
homepage = "Link to a Kotlin/Native module homepage"
// You can change the name of the produced framework.
// By default, it is the name of the Gradle project.
frameworkName = "shared"
ios.deploymentTarget = "10.0"
pod("GoogleWebRTC", "~> 1.1")
pod("AFNetworking", "~> 4.0.0")
}
I was able to reproduce this issue but I didn't figure out the reason why.
It seems a there's something wrong with GoogleWebRTC pod and the Kotlin-native/cocoapods integration.
I've opened an issue here.
We have an official help.
It seems that the frameworks name is different from the pod name. So a possible solution could be that:
kotlin {
cocoapods {
[...]
pod("GoogleWebRTC", moduleName = "WebRTC", version = "~> 1.1")
[...]
}
[...]
}
I tried it and it works.

Testing rx throws error on scheduler init

Unit test terminates if I write var scheduler = TestScheduler(initialClock: 0)
my imports
import XCTest
import RxTest
with error message
failed to demangle superclass of TestScheduler from mangled name '7RxSwift20VirtualTimeSchedulerCy0A4Test0fecD9ConverterVG'
pod versions
pod 'RxBlocking', '~> 5'
pod 'RxTest', '~> 5'
This is a bug of the Cocoapods + XCode 10.2 platform.
Statement from XCode 10.2 RC notes about known issues:
Linking against a static Swift library might create a binary with missing
type metadata because the object files that define the metadata inside the
static archive are mistakenly considered unused. (47598583)
This can manifest as a Swift runtime error with a message such as:
“failed to demangle superclass of MyClass from mangled name ‘<mangled name>’”.
Workaround: If you can rebuild the static library, try building it with whole module
optimization enabled.
Otherwise, add -all_load to the linker flags in the client binary to
ensure all object files are linked into it.
This thread and this solution should help you get rid of it.

Umbrella header 'CocoaAsyncSocket-umbrella.h' not found

With XCode 8.3 or lower, no values of variables are displayed:
When a variable T is output:
lldb> po t
Then XCode issues the following error message:
warning: Swift error in module testProject.
Debug info from this module will be unavailable in the debugger.
error: in auto-import:
failed to get module 'testProject' from AST context:
error: /Users/xxx/Library/Developer/Xcode/DerivedData/testProject-ancfblnaxqmiivgqakzxqkocqfrg/Build/Products/Debug-iphonesimulator/CocoaAsyncSocket/CocoaAsyncSocket.framework/Modules/module.modulemap:2:19: error: umbrella header 'CocoaAsyncSocket-umbrella.h' not found
umbrella header "CocoaAsyncSocket-umbrella.h"
I found few pages for this problem:
Move header on top
However, it has not solved the problem.
The problem might be CocoaPod. In the previous versions of CocoaPod, there was a problem that Pod Libraries could not be compiled. Because CocoaPod generates the umbrella-headers automatically.
Seems this is already answered at Swift Framework: Umbrella header '[...].h' not found, If not please share your podfile and further observations.

Private Swift Pod with ObjC static libraries

I am trying to create a private pod that ships with two static libraries.
Source of the pod is in swift however it depends upon two third party static libraries on which I have no control.
Linting my podspec, I get the following error just for the second lib (with a modulemap)
- ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code. You can use `--verbose` for more information.
- ERROR | xcodebuild: TestKit/TestKit/SSAIPolicy.swift:11:8: error: no such module 'SecondLib'
And, here is the source part of my podspec file:
spec.source_files = 'TestKit/*', 'Vendor/**/*.{h,modulemap}'
spec.vendored_libraries = 'Vendor/FirstLib/libService.a', 'Vendor/SecondLib/libManagement.a'
spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-ObjC' }
Note: I am able to use this framework just fine by compiling and dropping it manually in the main app
In case anyone needs to know, I got it working by changing 'Target Membership'
of header files in my library from 'Project' to 'Public'

RealmSwift import error

I have installed RealmSwift's dynamic frameworks in version 0.98.2.
(CocoaPods didn't work.)
I get the following error:
module-includes>:1:9: note: in file included from <module-includes>:1:
#import "/Users/adambella/Documents/Pesti_I.munka/FrontSide/FestivalApp-iOS/./Realm.framework/Headers/Realm.h"
^
/Users/adambella/Documents/Pesti_I.munka/FrontSide/FestivalApp-iOS/./Realm.framework/Headers/Realm.h:21:9: error: 'Realm/RLMArray.h' file not found
#import <Realm/RLMArray.h>
^
<unknown>:0: error: could not build Objective-C module 'Realm'
How can I fix it?
Try to import the import the framework not with an absolute path, but just as seen below.
#import <Realm/Realm.h>
In addition please navigate to your target’s “Build Settings”, and make sure that the parent path to RealmSwift.framework is included in the “Framework Search Paths” section.
Have you tried install it statically?
Just drag and drop the "Realm.framework", "RealmSwift.framework" files to your xcode project and check "copy items if need".
Then add the frameworks to the Embedded Binaries in your target project.
http://s8.postimg.org/6cmfwglkj/Captura_de_pantalla_2016_02_25_a_las_9_42_20_a_m.png
Clean build folder
Build folder location is
Users/{home_directory} /Library/Developer/Xcode/DerivedData/{app_name} -bxffdjvuyjrewicuwaxocbbgxzrq

Resources