2017-12-29 32 views
1

저는 EzoRed (ezored.com)라는 도구를 개발했습니다. 그것은 네이티브 코드 (C++)와 안드로이드에 대한 ios 또는 aar를위한 프레임 워크를 생성합니다.ObjectiveC 프레임 워크가 일부 클래스를 내 보내지 않습니다.

생성 된 xcode 프로젝트를 가져 와서 내 샘플 프로젝트로 끌어다 놓을 때 문제없이 프레임 워크를 사용합니다. 생성 된 프레임 워크 만 드래그하면 (프레임 워크의 디버그 버전으로 모든 것이 잘 작동하지만 Release가 작동하지 않습니다.), 내 앱이 장치 나 시뮬레이터에 컴파일되지만 오류가 발생합니다 :

enter image description here

nm 도구를 사용하여 내 보낸 기호를 확인하고 * Impl 클래스 만 내 보낸 것을 확인합니다. 참조 : 모든 문제없이 컴파일하기 때문에 그것은 매우 이상하다

nm -gU build/ios/Release-universal/EzoRed.framework/EzoRed

0000000000010a88 S _OBJC_CLASS_$_EZRAudioStreamerPlatformServiceImpl 
0000000000010b28 S _OBJC_CLASS_$_EZRGreetingMessagePlatformServiceImpl 
00000000000109e8 S _OBJC_CLASS_$_EZRHttpClientPlatformServiceImpl 
0000000000010ab0 S _OBJC_METACLASS_$_EZRAudioStreamerPlatformServiceImpl 
0000000000010b50 S _OBJC_METACLASS_$_EZRGreetingMessagePlatformServiceImpl 
0000000000010a10 S _OBJC_METACLASS_$_EZRHttpClientPlatformServiceImpl 
0000000000010d30 D __ZTIPU39objcproto28EZRHttpClientPlatformService11objc_object 
0000000000010fa0 D __ZTIPU42objcproto31EZRAudioStreamerPlatformService11objc_object 
0000000000011200 D __ZTIPU44objcproto33EZRGreetingMessagePlatformService11objc_object 
0000000000010d18 D __ZTIU39objcproto28EZRHttpClientPlatformService11objc_object 
0000000000010f88 D __ZTIU42objcproto31EZRAudioStreamerPlatformService11objc_object 
00000000000111e8 D __ZTIU44objcproto33EZRGreetingMessagePlatformService11objc_object 
000000000000c700 S __ZTSPU39objcproto28EZRHttpClientPlatformService11objc_object 
000000000000c9c0 S __ZTSPU42objcproto31EZRAudioStreamerPlatformService11objc_object 
000000000000cca0 S __ZTSPU44objcproto33EZRGreetingMessagePlatformService11objc_object 
000000000000c740 S __ZTSU39objcproto28EZRHttpClientPlatformService11objc_object 
000000000000ca00 S __ZTSU42objcproto31EZRAudioStreamerPlatformService11objc_object 
000000000000cce0 S __ZTSU44objcproto33EZRGreetingMessagePlatformService11objc_object 

.

프레임 워크의 디버그 버전으로 모든 것이 잘 작동합니다. 그러나 출시와 함께 작동하지 않습니다.

일부 검사 : 그것은 다리 파일에 포함 된

: https://github.com/ezored/sample-app/blob/master/source/ios/SampleApp/SampleApp/SampleApp-Bridging-Header.h

그것은 CMakeLists.txt에 있던 :
https://github.com/ezored/sample-app/blob/master/vendor/target-ios-master/CMakeLists.txt#L132

그것은 컴파일 문제없이 설치할 수 있지만 실행되지. 그것은 위로 메시지를 보여줍니다.

모든 프로젝트 파일은 여기, 사람이 다운로드하고 실행할 수 있습니다
https://github.com/ezored/sample-app

사용되는 명령은 다음과 같습니다

xcodebuild build -configuration "Debug" (is exported all files correct) 
xcodebuild build -configuration "Release" (is exported only *Impl files) 
:

cmake --build . --config Debug (is exported all files correct) 
cmake --build . --config Release (is exported only *Impl files) 

Xcode의 직접 명령은 같은 효과를가집니다

뭐가 잘못 됐니? 어떤 도움을 주셔서 감사합니다.

답변

0

난 내 CMakeLists.txt에 라인을 넣어 발견 된 솔루션 :

set(CMAKE_CXX_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility=hidden -fvisibility-inlines-hidden -fobjc-abi-version=2 -fobjc-arc ${CXX_FLAGS}")

https://github.com/ezored/target-ios/blob/master/build/files/ios.cmake#L284

: 파일 ios.cmake

CXX_VISIBILITY_PRESET default

을 내가 라인을 가지고

모범 사례인지 알고 싶습니다. 앱에서 앱을 시험해 보겠습니다. 그것으로 저장하십시오.