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

オープン
#99 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
30/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
停滞
技術スタック
ios, javascript

調査の方向性

App_Resources/iOS/Podfile を使用し、Mapbox-iOS-SDK または Braintree の依存関係を指定してシミュレータービルドを再現し、@nativescript/ios 7.0.0 と 7.0.1–7.1.0 を比較します。まず platforms/ios のビルド出力と、i386 および x86_64 に関する metadata-generator の内部エントリから始めます。設定したアプリがアーキテクチャのリンカーエラーなしで iOS シミュレーター上でビルドおよび実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

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!

主要言語
JavaScript
スター
150
フォーク
43
平均マージ
3日 10時間
マージ済み PR(30日)
22

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

NativeScript/ios のほかの issue

NativeScript/ios の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。