NativeScript / NativeScript/ios

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

Offen
#99 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Vorherrschende Sprache
JavaScript
Sterne
150
Forks
43
Ø Merge
3 T. 10 Std.
Gemergte PRs (30 T.)
22

Beschreibung

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!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Reproduziere den Simulator-Build mithilfe von App_Resources/iOS/Podfile mit der Mapbox-iOS-SDK- oder Braintree-Abhängigkeit und vergleiche @nativescript/ios 7.0.0 mit 7.0.1–7.1.0. Beginne mit der platforms/ios-Buildausgabe und den internen metadata-generator-Einträgen für i386 und x86_64; abgeschlossen ist die Aufgabe, wenn die konfigurierte App auf dem iOS-Simulator ohne die Architektur-Linkerfehler gebaut wird und läuft.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
ios, javascript
Bereich
build-system, mobile
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.