Open kinglezhuang opened 5 years ago
PRIVATE_FRAMEWORKS_PATH=${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}
mkdir -p ${PRIVATE_FRAMEWORKS_PATH}
cp -RH /Users/admin/.conan/data/pubnub/1.0.0/internal/test/package/c7e2294e57bbb3e824ab0cefd2a2e13f20c8c04e/PubNub.framework ${PRIVATE_FRAMEWORKS_PATH}
so i use above script to copy the file, it can work fine now. Is it the right way?
Does anybody give me an answer how to do it?
@memsharded
Can you help me to solve such problem?
I wrote a script for xcode intergration. Is it ok?
Hi, I'll take a look and answer asap. Just a preliminar recommendation about your recipe:
def configure(self):
if self.settings.os == "iOS":
self.settings.os.version = 10.0
elif self.settings.os == "Android":
self.settings.os.api_level = 21
else:
raise Exception("Error: not support os!")
Don't do that with the settings. You should apply a profile with the os.version
and the os.api_level
when Android, not assign them in the configure
method. Then if you receive other values that you don't want to support you should raise ConanInvalidConfiguration()
(imported from conan.errors)
@lasote
Thank you your reply. It's my demo app, not in production.
By the way, how to integrate into xcode project when consume framework from server, i wrote a script to copy the framework into app bundle, Is it the right way to do that? Because of all frameworks need to be copied into app's bundle on iOS platform.
Well, during the application development, as the xcode
generator is adjusting the FRAMEWORK_SEARCH_PATHS
to the root folder of your packages (/Users/kingle.zhuang/.conan/data/pubnub/1.0.0/internal/test/package/c7e2294e57bbb3e824ab0cefd2a2e13f20c8c04e
) it should automatically find the Frameworks and build the application.
But, if you say that all frameworks need to be copied into the app's bundle on iOS you can write a deploy method in the recipe of your application to import whatever you want from your dependencies and the application itself. So, you could run conan install app/1.0@foo/bar
and it will copy to the local install directory all the frameworks. It could be something similar to (not tried):
def deploy(self):
self.copy("MyApp") # copy from current package
self.copy_deps("*.framework") # copy from dependencies
Copy action is in building time, not in pre build phase
You can use imports
method instead. https://docs.conan.io/en/latest/reference/conanfile/methods.html#imports
I followed the document to export the framework library in my local cache, then consumed it by Xcode generator. It can build success but launch failed. Following is an error tip:
It seams Xcode doesn't copy the image into app bundle. How to solve such problem?
DemoApp.zip