Writing an Appcelerator Titanium iOS module with 3rd party Framework - ios

I'm trying to write a new module with an external framework. I've followed the instructions here: http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Module_Project-section-43288810_iOSModuleProject-AddaThird-PartyFramework on how to add an external frame work.
The module compiles. The Titanium app also compiles. But when inside the iPhone emulator the application crashes (even before using the module).
I'm getting the following error in Titnaium Studio:
[ERROR] : An error occurred during build after 1m 19s 125ms
[ERROR] : Detected multiple crashes:
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193036_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193042_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193122_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-05-193354_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-064617_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072141_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072205_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-072249_Ophirs-Mac-mini.crash
[ERROR] : /Users/ophir/Library/Logs/DiagnosticReports/SweetAlertDialogTest_2015-11-06-073843_Ophirs-Mac-mini.crash
[ERROR] : Note: these crashes may or may not be related to running your app.
TRACE | titanium exited with exit code 1
ERROR | Error: ti run exited with error code 1
at ChildProcess.<anonymous> (/Users/ophir/.appcelerator/install/5.0.4/package/node_modules/appc-cli-titanium/plugins/run.js:92:66)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:820:12)
TRACE | Sending exit signal to titanium process: 19220
I checked inside the crash log and this is what I get:
Dyld Error Message:
Library not loaded: #rpath/SweetAlertFramework.framework/SweetAlertFramework
Referenced from: /Users/USER/Library/Developer/CoreSimulator/Devices/6451C367-A7B7-437D-956F-57E86D8419FD/data/Containers/Bundle/Application/683ED437-B0E6-42F0-BC8E-26B2E95829CA/SweetAlertDialogTest.app/SweetAlertDialogTest
Reason: image not found
I've checked the path inside module.xcconfig and it's correct. Another thing that seems strange here is the path in the crash log /Users/USER/Library/Developer/CoreSimulator/Devices/6451C367-A7B7-437D-956F-57E86D8419FD/data/Containers/Bundle/Application/683ED437-B0E6-42F0-BC8E-26B2E95829CA/SweetAlertDialogTest.app/SweetAlertDialogTest which is not a valid path on my machine.
Why doesn't it find the module?

I think #HansKnoechel meant to say *.framework, and iphone/platform. That way, when the module is actually bundled, the framework will be included as well. You can verify the framework is in the right place by checking the modules/iphone/<YourModule>/<YourModuleVersion>/platform directory.

It looks like the bundle of the 3rd party framework could not be referenced. Make sure you copy the *.framework files into platform/ios so they will be compiled. Also check the Xcode settings "Link binary with libraries" and make sure it is listed there.

Related

iOS KMP Command PhaseScriptExecution failed with a nonzero exit code

I have a Kotlin multiplatform project, I can build Android app, but I cannot build iOS app. The full error message below.
Exception in thread "main" java.lang.Error: /var/folders/2d/bfr1v4wn0nd926jj62ztw0m80000gn/T/9075457888541413881.m:1:9: fatal error: module 'FirebaseFirestore' 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:messaging:cinteropFirebaseMessagingIos (Thread[Execution worker for ':' Thread 4,5,main]) completed. Took 6.427 secs.
Please help me on this, thank you so much.
If you dive deeper into the stacktrace you can find that cinterop fails with: module FirebaseFirestore not found
Possible solutions:
Make sure you reference firebase pods properly with the cocoapods gradle plugin: FirebaseFirestore instead of Firebase/Firestore for ex.
Check out the following issues if 1) is not a problem https://youtrack.jetbrains.com/issue/KT-42038 and
https://youtrack.jetbrains.com/issue/KT-47935

Why does the build fail trying to find boost.hpp?

I am trying to build IoTivity for iOS and following the instructions here but I keep getting this error which terminates the build.
service/resource-encapsulation/include/RCSException.h:33:10: fatal error: 'boost/config.hpp'
file not found
#include <boost/config.hpp>
^~~~~~~~~~~~~~~~~~
1 error generated.
scons: *** [out/ios/arm64/debug/service/resource-encapsulation/src/common/expiryTimer/src/ExpiryTimerImpl.o] Error 1
scons: building terminated because of errors.
When I look in my boost framework, I do see the config.hpp file. Does anyone have any ideas why it would be unable to find the file.

React native build to device failed

I'm trying to build to an iOS device, building to simulator works fine.
This is what I get:
uncaught error Error: TypeError: unsupported file type at lookup (/Users/NAME/git/vex/vex-app react/VexAppReact/node_modules/image-size/lib/index.js:35:9)
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/image-size/lib/index.js:93:22
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/image-size/lib/index.js:50:9
at /Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:82:15)
See logs /var/folders/h8/42h3w_qd2r9fvpwy99jsnjq40000gn/T/react-packager.log
at SocketClient._handleMessage (SocketClient.js:144:23)
at BunserBuf. (SocketClient.js:53:42)
at emitOne (events.js:90:13)
at BunserBuf.emit (events.js:182:7)
at BunserBuf.process (/Users/NAME/git/vex/vex-app-react/VexAppReact/node_modules/bser/index.js:289:10)
at /Users/NAME/git/vex/vex-app react/VexAppReact/node_modules/bser/index.js:244:12
at nextTickCallbackWith0Args (node.js:452:9)
at process._tickCallback (node.js:381:13)
Command /bin/sh failed with exit code 1
I'm assuming there's something wrong with image assets. I didn't install the image-size node module myself, so I doubt there's something wrong with that module, it could be though.
Any suggestions welcome.
Solution: apparently you can't add png files to native ios build

Appcelerator won't create build when I am using card.io module, module from gittio is com.likelysoft.cardio

I have added module com.likelysoft.cardio from gittio and trying to create build but it's showing me following error :
[ERROR] : ** BUILD FAILED **
[ERROR] : The following build commands failed:
[ERROR] : Ld build/---\ --.build/Debug-iphoneos/--\ --.build/Obje normal/arm64/--\ -- normal arm64
[ERROR] : Ld build/--\ --.build/Debug-iphoneos/--\ --.build/Objects-normal/armv7/--\ -- normal armv7
[ERROR] : (2 failures)
But when I am trying to build project by removing this module from tiapp.xml, it works. (it's create build).
Also by adding this module it works on simulator. :(
where Actually I am going wrong ?
Thanks.
I have resolved this problem by Updating my xcode to 7 and Appcelerator SDK to 5.0.2 GA and it's working fine now, and I can create build now. :)

Getting error as /tmp/checker-276/bin/clang failed with exit code 71 when analyzing the code using Xcode's built in analyzer

When i am analysing the project using Xcode's static analyser i am getting following error:
/tmp/checker-276/bin/clang failed with exit code 71
I have tried lots of solutions, but couldn't fixed it.

Resources