@nativescript/ios >= 7.0.1: Undefined symbols for architecture i386

Đang mở
#99 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
ios, javascript
Lĩnh vực
build-system, mobile

Hướng nghiên cứu

Tái hiện quá trình build trình mô phỏng bằng App_Resources/iOS/Podfile với dependency của Mapbox-iOS-SDK hoặc Braintree, đồng thời so sánh @nativescript/ios 7.0.0 với 7.0.1–7.1.0. Bắt đầu với output build của platforms/ios và các entry metadata-generator nội bộ cho i386 và x86_64; hoàn tất khi app đã cấu hình build và chạy trên trình mô phỏng iOS mà không có lỗi linker về kiến trúc.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

My config

  • NativeScript CLI 7.1.2 (also tried previous versions)
  • @nativescript/ios 7.1.0 (problem exists since 7.0.1, 7.0.0 is working)
  • xcode 12.2 (also tried 12.1 and 12.3 but same issue)

The problem
When creating a new NativeScript app and adding the following to App_Resources/iOS/Podfile:

platform :ios, '9.0'
pod 'Mapbox-iOS-SDK', '~> 6.3.0'

or

pod 'Braintree', '4.36.1'

I have trouble to build the app and run the app on iOS in some situations.

  • Using @nativescript/ios 7.0.0**

    • app is building and running on simulator and device
  • Using @nativescript/ios 7.0.1 - 7.1.0

    • app is running on physical device
    • app is NOT running on simulator
    • tns run ios --release is failing with the same error message as trying to run it on device:

Project successfully prepared (ios)
Building project...
Xcode build...
warning: Stale file '/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/sharedpch/SharedPrecompiledHeaders/1429772644690191759/testapp-Prefix.pch.gch' is located outside of the allowed root paths.

warning: Stale file '/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/sharedpch/SharedPrecompiledHeaders/9659924947654793526/testapp-Prefix.pch.gch' is located outside of the allowed root paths.

./.build_env_vars.sh: line 441: declare: UID: readonly variable
NSLD: Swift bridging header '*-Swift.h' not found under '/Users/felixkrautschuk/Library/Developer/Xcode/DerivedData/testapp-cefposwjsgscvxbviyywdtdofqkw/Build/Intermediates.noindex/testapp.build/Debug-iphonesimulator/testapp.build/Objects-normal/i386'
Generating metadata...~/Downloads/testapp/platforms/ios/internal/metadata-generator/bin ~/Downloads/testapp/platforms/ios
Python version: 2.7.16 (default, Jun 5 2020, 22:59:21)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc-
Generating metadata for x86_64
Metadata Generator Arguments:
./objc-metadata-generator -verbose -output-bin /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/metadata-x86_64.bin -output-umbrella /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/umbrella-x86_64.h -docset-path /Users/felixkrautschuk/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset Xclang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk -mios-simulator-version-min=9.0 -std=gnu99 -target x86_64-apple-ios13.0-macabi -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/include -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents/MapboxMobileEvents.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/Swift-Modules -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../App_Resources/iOS/src -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/ -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/Pods/Mapbox-iOS-SDK/dynamic -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios -DCOCOAPODS=1 -DDEBUG=1
Clang Arguments:
"-v", "-x", "objective-c", "-fno-objc-arc", "-fmodule-maps", "-ferror-limit=0", "-Wno-unknown-pragmas", "-Wno-ignored-attributes", "-Wno-nullability-completeness", "-Wno-expansion-to-defined", "-D__NATIVESCRIPT_METADATA_GENERATOR=1", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk", "-mios-simulator-version-min=9.0", "-std=gnu99", "-target", "x86_64-apple-ios13.0-macabi", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/include", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents/MapboxMobileEvents.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/Swift-Modules", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../App_Resources/iOS/src", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/Pods/Mapbox-iOS-SDK/dynamic", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios", "-DCOCOAPODS=1", "-DDEBUG=1",
Merged 849 categories.
Result: 46392 declarations from 156 top level modules
Done! Running time: 5.495 sec
Saving metadata generation's stderr stream to: /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-x86_64.txt
Generating metadata for i386
Metadata Generator Arguments:
./objc-metadata-generator -verbose -output-bin /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/metadata-i386.bin -output-umbrella /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/umbrella-i386.h -docset-path /Users/felixkrautschuk/Library/Developer/Shared/Documentation/DocSets/com.apple.adc.documentation.iOS.docset Xclang -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk -mios-simulator-version-min=9.0 -std=gnu99 -target i386-apple-ios13.0-macabi -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/include -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents/MapboxMobileEvents.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/Swift-Modules -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../App_Resources/iOS/src -I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/ -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/Pods/Mapbox-iOS-SDK/dynamic -F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios -DCOCOAPODS=1 -DDEBUG=1
Clang Arguments:
"-v", "-x", "objective-c", "-fno-objc-arc", "-fmodule-maps", "-ferror-limit=0", "-Wno-unknown-pragmas", "-Wno-ignored-attributes", "-Wno-nullability-completeness", "-Wno-expansion-to-defined", "-D__NATIVESCRIPT_METADATA_GENERATOR=1", "-isysroot", "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.2.sdk", "-mios-simulator-version-min=9.0", "-std=gnu99", "-target", "i386-apple-ios13.0-macabi", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/include", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents/MapboxMobileEvents.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/Swift-Modules", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../App_Resources/iOS/src", "-I/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/internal/", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/Pods/Mapbox-iOS-SDK/dynamic", "-F/Users/felixkrautschuk/Downloads/testapp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios", "-DCOCOAPODS=1", "-DDEBUG=1",
Merged 849 categories.
Result: 46392 declarations from 155 top level modules
Done! Running time: 5.2533 sec
Saving metadata generation's stderr stream to: /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-i386.txt
~/Downloads/testapp/platforms/ios
ld: warning: ld: warning: ignoring file /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/TKLiveSync.framework/TKLiveSync, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64ignoring file /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/NativeScript.framework/NativeScript, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64

ld: warning: ignoring file /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/MDFInternationalization, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
ld: warning: ignoring file /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MapboxMobileEvents/MapboxMobileEvents.framework/MapboxMobileEvents, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
ld: warning: ignoring file /Users/felixkrautschuk/Downloads/testapp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/MaterialComponents, building for iOS Simulator-i386 but attempting to link with file built for iOS Simulator-x86_64
Undefined symbols for architecture i386:
"OBJC_CLASS$_Config", referenced from:
objc-class-ref in main.o
"OBJC_CLASS$_NativeScript", referenced from:
objc-class-ref in main.o
(maybe you meant: OBJC_CLASS$_NativeScriptEmbedder)
"_TNSInitializeLiveSync", referenced from:
_main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Building targets in parallel
note: Using codesigning identity override:
note: Planning build
note: Constructing build description
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.2.99. (in target 'MDFInternationalization' from project 'Pods')
** BUILD FAILED **

Unable to apply changes on device: D4022399-722F-4DC5-92B0-6001474E4A7B. Error is: Command xcodebuild failed with exit code 65.

So I guess the important part is:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Config", referenced from:
      objc-class-ref in main.o
  "_OBJC_CLASS_$_NativeScript", referenced from:
      objc-class-ref in main.o
     (maybe you meant: _OBJC_CLASS_$_NativeScriptEmbedder)
  "_TNSInitializeLiveSync", referenced from:
      _main in main.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The newly created NativeScript app using @nativescript/ios 7.1.0 and the Mapbox-iOS-SDK Podfile can be found here:
testapp.zip

There is already a discussion on Github for the nativescript mapbox plugin here: https://github.com/nativescript-community/ui-mapbox/issues/3#issuecomment-732140591 . Yes, it might be related to the Mapbox-iOS-SDK somehow, as this problem does not exist for all Pods, for example pod 'Google-Mobile-Ads-SDK', '7.67.0' is working fine with the latest ios v8 runtime.

BUT the error message above sounds like a NativeScript issue, and when I create a new native Xcode iOS App Project and add the Mapbox Pod there, xcode is building and running the project in Simulator as expected.
The native xcode project can be found here:
iosmapboxapp.zip
(Run pod install first, when you want to try it out).

It would be nice if we could use the latest ios runtime and also all ios pods without having problems to build the ios app.
Thanks in advance!

Ngôn ngữ chính
JavaScript
Star
150
Fork
43
Merge trung bình
3 ngày 10 giờ
Pull request đã merge (30 ngày)
22

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NativeScript/ios

Tất cả issue của NativeScript/ios

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.