How to add a ios-framework to qt-project ?
-
wrote on 18 Jun 2019, 02:06 last edited by Kegin
I want to add a ios_framework to my qt-project,
It is located the at /Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
I already set the .pro
but when I run the app on the IPhone,
I get a issue , the app was crashed.dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
Reason: image not foundThis is my setting of .pro
ios:
{
QMAKE_LFLAGS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
LIBS += -framework MyFramework
}What's the wrong? How can i do? Please help me. thanks.
-
I want to add a ios_framework to my qt-project,
It is located the at /Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
I already set the .pro
but when I run the app on the IPhone,
I get a issue , the app was crashed.dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
Reason: image not foundThis is my setting of .pro
ios:
{
QMAKE_LFLAGS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS/MyFramework.framework
LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
LIBS += -framework MyFramework
}What's the wrong? How can i do? Please help me. thanks.
@Kegin From your description it is not clear what you already did.
Did you install XCode?
Did you install Qt for iOS?
Do you have an iOS Kit in QtCreator?
Did you successfully build your app? -
wrote on 18 Jun 2019, 05:48 last edited by Kegin
thank your reply.
yes,
I have installed Xcode,
I think the environment is correct.before I don't add the iOS-framework,
I have successfully run first app on iPhone,but when I want add the ios-framework,
modify my project (.pro),
add some settings
it crashed, and could not run...Error saying it can't load the ios-framework
when I want use api of third-party iOS-framework
how can I change the settings of .pro? -
thank your reply.
yes,
I have installed Xcode,
I think the environment is correct.before I don't add the iOS-framework,
I have successfully run first app on iPhone,but when I want add the ios-framework,
modify my project (.pro),
add some settings
it crashed, and could not run...Error saying it can't load the ios-framework
when I want use api of third-party iOS-framework
how can I change the settings of .pro?@Kegin
a vague answer to a vague questionLIBS += -framework frameworkName
-
wrote on 18 Jun 2019, 06:16 last edited by Kegin
Sorry, may I did not clearly explain my problem.
So.. if i want to link a third-party ios-framework,
Just add the “LIBs += ...“ ?But i already add the lines to .pro
LIBS += -F/Volumes/Data/SvnData/Codes/Libraries/IOS
LIBS += -framework MyFrameworkBefore i don’t modify .pro for use ios-framework
I build the app is successfully
run the app also is successfully.I tried..
I include the header-path of ios-framework in my codes.
It can found, and it build successlly,
But when i run it, it crash at running timeThe error is
dyld: Library not loaded: @rpath/MyFramework.framework/MyFramework
Referenced from: /var/containers/Bundle/Application/3BB2B369-0047-4952-B0BE-47EF91019DE9/test.app/test
Reason: image not found -
wrote on 18 Jun 2019, 08:26 last edited by Kegin
I am trying to link GoogleMobileAds.framework,
It is working fineBut I link MyFramework.framework
It runs and crashesI found the difference between two frameworks.
MyFramework.framework has a file, it is execMyFramework.framework is a dynamically linked shared library.
According to this article
https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804Maybe I need to add MyFramework.framework to "Embedded Binaries"? How to set this in QT-Project?
-
I am trying to link GoogleMobileAds.framework,
It is working fineBut I link MyFramework.framework
It runs and crashesI found the difference between two frameworks.
MyFramework.framework has a file, it is execMyFramework.framework is a dynamically linked shared library.
According to this article
https://stackoverflow.com/questions/24333981/ios-app-with-framework-crashed-on-device-dyld-library-not-loaded-xcode-6-beta/28469804Maybe I need to add MyFramework.framework to "Embedded Binaries"? How to set this in QT-Project?
wrote on 5 Mar 2020, 22:52 last edited by David K. Hess 3 May 2020, 22:54@Kegin (and anybody else who stumbles on this), see this comment and mine following it:
Summarized, you need to spec the framework in QMAKE_BUNDLE_DATA and then add a linker switch to make sure the executable can find it at run time.