Xcode 5로 업데이트 한 후-ld : 아키텍처 armv7 또는 armv7s 링커 오류에 대한 기호를 찾을 수 없음
새로운 앱 (Phonegap)을 최종 수정하는 도중에 iPhone 4S 소프트웨어를 iOS 7 베타 2로 업데이트했습니다. 좋은 생각이 아닙니다!
완료 후 Xcode가 내 iPhone을 감지하지 못하여 Xcode 5 베타를 설치했습니다. 그것을 둘러 본 후 마침내 내 휴대 전화를 감지했습니다. 이제 유일한 문제는 사용 된 아키텍처에 오류가 있다는 것입니다.
생성되는 오류는 다음과 같습니다.
ld: warning: ignoring file /Users/-----------/Library/Developer/Xcode/DerivedData/testtest-bmnbmujiosugcmgeiceofgcfmsec/Build/Products/Debug-iphoneos/libCordova.a, file was built for archive which is not the architecture being linked (armv7s): /Users/--------/Library/Developer/Xcode/DerivedData/testtest-bmnbmujiosugcmgeiceofgcfmsec/Build/Products/Debug-iphoneos/libCordova.a
Undefined symbols for architecture armv7s:
"_OBJC_METACLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_METACLASS_$_MainCommandDelegate in MainViewController.o
"_CDVLocalNotification", referenced from:
-[AppDelegate application:didReceiveLocalNotification:] in AppDelegate.o
"_OBJC_CLASS_$_CDVCommandDelegateImpl", referenced from:
_OBJC_CLASS_$_MainCommandDelegate in MainViewController.o
"_OBJC_CLASS_$_CDVCommandQueue", referenced from:
_OBJC_CLASS_$_MainCommandQueue in MainViewController.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_MainViewController in MainViewController.o
"_OBJC_METACLASS_$_CDVCommandQueue", referenced from:
_OBJC_METACLASS_$_MainCommandQueue in MainViewController.o
"_CDVPluginHandleOpenURLNotification", referenced from:
-[AppDelegate application:handleOpenURL:] in AppDelegate.o
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_MainViewController in MainViewController.o
ld: symbol(s) not found for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
내 휴대폰에서 작동하려면 아키텍처를 어떻게 변경해야하는지에 대한 아이디어가 있습니까? (에뮬레이터에서 잘 작동합니다)
짧은 답변:
- 제거 빌드 액티브 아키텍처 만 (빌드 설정 매개 변수 키는 'ONLY_ACTIVE_ARCH') NO '와 프로젝트 빌드 설정하거나 덮어 쓰기'정적 라이브러리 모두에서 아래의 스크린 샷처럼 :
자세한 답변 :
문제는 기본 앱에서 연결하는 정적 라이브러리 'libCordova.a'가 하나의 아키텍처 (armv7이 아닌 armv7)에 대해서만 컴파일된다는 것입니다.
이러한 변경 사항이 실제로 무엇인지 읽지 않고 Xcode가 정적 라이브러리 프로젝트에 권장되는 모든 변경 사항을 수행하도록했을 것입니다. 지금까지 Xcode의 새 버전으로 전환했을 때 정보 대화 상자 (아래 스크린 샷)를 자세히 살펴 보지 않았습니다.
문제는 디버그 빌드에 대해 이러한 변경을 수행하면 Build Active Architecture Only 라는 새로운 기능이 활성화된다는 것입니다 (빌드 설정 매개 변수 키는 'ONLY_ACTIVE_ARCH'임). 원칙적으로 이것은 Xcode의 매우 멋진 개선 사항입니다.이를 YES로 설정하면 빌드 시간이 빨라집니다. Xcode는 실행 버튼을 누를 때 현재 상단에서 선택한 연결된 장치의 아키텍처 만 컴파일하기 때문입니다.
그러나 정적 라이브러리에서이 새 매개 변수를 맹목적으로 수락하면이 버그가 발생할 수 있습니다. 이 버그는 armv7 장치를 연결 한 상태에서 정적 라이브러리의 디버그 버전을 빌드 한 다음 주 애플리케이션을 디버깅 할 때 armv7s 장치를 연결했을 때 (또는 그 반대의 경우) 발생합니다. 그러면 위의 오류 (또는 유사한 오류)가 표시됩니다.
따라서 내 권장 사항은 모든 정적 라이브러리의 프로젝트 빌드 설정에서 Build Active Architecture Only에 대한 프로젝트 수준의 값을 완전히 제거하는 것입니다. iOS 기본값을 살펴보면 NO입니다. 물론 나중에 기본값이 변경 되더라도 설정이 올바른지 확인하기 위해 설정을 'NO'로 덮어 쓸 수도 있습니다 (첫 번째 스크린 샷 참조).
프로젝트가 Cordova 2.x 및 Xcode 4.x를 사용하여 빌드되었고 OP에서 언급 한 오류가 표시되는 경우이 솔루션이 저에게 효과적이었습니다. (Cordova 2.5 및 Xcode 5에서 오류가 발생했습니다).
https://issues.apache.org/jira/browse/CB-3768
Cordova 프로젝트로 이동
루트 폴더-> CordovaLib-> CordovaLib.xcodeproj-> 패키지 내용 표시-> project.pbxproj 열기를 마우스 오른쪽 단추로 클릭하십시오.
(I had 4)의 모든 항목을 바꿉니다.
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;//in 2 out of 4 occurrences
"ARCHS[sdk=iphoneos*]" = armv7;
"ARCHS[sdk=iphoneos6.*]" = (
armv7,
armv7s,
);
/* other settings here */
};
With this
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;//in 2 out of 4 occurrences
"ARCHS[sdk=iphoneos*]" = armv7;
"ARCHS[sdk=iphoneos7.*]" = (
armv7,
armv7s,
);
"ARCHS[sdk=iphoneos6.*]" = (
armv7,
armv7s,
);
/* other settings here */
};
Now your project will build fine!
I have removed armv7s
from valid architectures
section and it worked for me.
Build Settings --> Architectures --> Valid Architectures
I am using Xcode 5 so iOS SDK 7. The solution which worked for me was simply to remove the arm64 architecture.
Select the project target (NOT CordovaLib.xcodeproj) and in the build settings>Valid Architectures, remove arm64 if it's there in the list. Here is mine after I remove arm64 architecture.
Because my lib.a is for only armv7
what i did was
Active Architecture Only = yes
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
"ARCHS[sdk=iphoneos*]" = (
armv7s,
armv7,
);
"ARCHS[sdk=iphoneos6.*]" = (
armv7s,
armv7,
);
"ARCHS[sdk=iphoneos7.*]" = (
armv7,
armv7s,
);
it was build and archived fine
hope it helps
njtman had a correct answer. I don't have the rep to comment so I am adding more details.
You need a iOS 7 SDK to use the standard architectures (armv7,armv7s).
My project was defaulting to (armv7), not including armv7s.
이 문제를 해결하려면 CordovaLib.xcodeproj를 열고 빌드 설정 (맨 위 행의 메뉴 중 하나, 가운데 맞춤)에서 아키텍처, 아키텍처, 디버그 및 릴리스에서 표준 아키텍처를 사용하여 iOS 7.0을 추가합니다.
빌드 설정에서 ...
Strip Debug Symbols During Copy:
Debug: No
Release: No
'programing tip' 카테고리의 다른 글
Python에서 HTTP Get Web Request를 어떻게 보내나요? (0) | 2020.11.04 |
---|---|
vba를 사용하여 XML을 구문 분석하는 방법 (0) | 2020.11.04 |
원격 서버에서 오류를 반환했습니다. (407) 프록시 인증 필요 (0) | 2020.11.03 |
Objective-C에서 두 배열을 어떻게 결합합니까? (0) | 2020.11.03 |
실패 [INSTALL_FAILED_INVALID_APK] (0) | 2020.11.03 |