iOS build error: framework not found TNSWidgets NS 7.2 Xcode 12.4
Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):
- CLI: 7.2.0
- Cross-platform modules: 7.2.1
- Android Runtime: -
- iOS Runtime: 7.2.0 (also tested 7.0.0)
- XCode Version: 12.4
- Plugin(s): -
Describe the bug When removing the platforms/ios directory and trying to rebuild the app for iOS after that, the app crashes:
ld: framework not found TNSWidgets
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(see the complete log at the end of this post)
This issue does NOT occur when using @nativescript/core 7.1.4, it happens when using the 7.2.0 or 7.2.1, probably due to this change: https://github.com/NativeScript/NativeScript/pull/9167 Maybe the issue should be moved to the @nativescript/core thread, but as this is about failing build I decided to post this here.
To Reproduce
- create a new project or use the sample project provided below
-
tns run ios-> build should work fine - remove platforms/ios folder
-
tns run ios-> build will fail - remove node_modules folder
-
npm install->tns run ios-> build will succeed again
Expected behavior The app should build correctly, even after removing the platforms/ios folder. (like ist was working until @nativescript/core 7.1.4).
Sample project temp.zip
Additional context
complete log:
felixkrautschuk@Felixs-MBP temp % tns run ios Searching for devices... Copying template files... Platform ios successfully added. v7.0.0 Preparing project... File change detected. Starting incremental webpack compilation...
webpack is watching the files…
Hash: c7aa2d88432209d1305b Version: webpack 4.44.2 Time: 4554ms Built at: 02/12/2021 2:24:51 PM Asset Size Chunks Chunk Names bundle.js 23.3 KiB bundle [emitted] bundle package.json 957 bytes [emitted]
runtime.js 77.1 KiB runtime [emitted] runtime tns_modules/inspector_modules.js 742 bytes tns_modules/inspector_modules [emitted] tns_modules/inspector_modules vendor.js 6.12 MiB vendor [emitted] vendor Entrypoint bundle = runtime.js vendor.js bundle.js Entrypoint tns_modules/inspector_modules = runtime.js vendor.js tns_modules/inspector_modules.js [./ sync ^./app.(css|scss|less|sass)$] . sync nonrecursive ^./app.(css|scss|less|sass)$ 174 bytes {bundle} [built] [./ sync recursive (?<!@nativescript/core/inspector_modules)(?<!\bApp_Resources\b.)(?<!./\btests\b/.?).(xml|css|js|(?<!.d.)ts|(?<!\b_[\w-].)scss)$] . sync (?<!@nativescript/core/inspector_modules)(?<!\bApp_Resources\b.)(?<!./\btests\b/.?).(xml|css|js|(?<!.d.)ts|(?<!\b_[\w-].)scss)$ 270 bytes {bundle} [built] [./app-root.xml] 309 bytes {bundle} [optional] [built] [./app.css] 317 bytes {bundle} [optional] [built] [./app.ts] 1.99 KiB {bundle} [built] [./main-page.ts] 1.36 KiB {bundle} [optional] [built] [./main-page.xml] 1.87 KiB {bundle} [optional] [built] [./main-view-model.ts] 1.04 KiB {bundle} [built] [~/package.json] external "~/package.json" 42 bytes {bundle} {tns_modules/inspector_modules} [optional] [built] + 333 hidden modules Webpack compilation complete. Watching for file changes. Webpack build done! Installing pods... Analyzing dependencies Downloading dependencies Installing MDFInternationalization (2.0.0) Installing MaterialComponents (94.5.0) Generating Pods project Integrating client project[!] Please close any current Xcode sessions and use
temp.xcworkspacefor this project from now on. Pod installation complete! There is 1 dependency from the Podfile and 2 total pods installed.[!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via
pod repo remove master. To suppress this warning please addwarn_for_unused_master_specs_repo => falseto your Podfile. Updating runtime package.json with configuration values... Project successfully prepared (ios) Building project... Xcode build... ./.build_env_vars.sh: line 434: declare: UID: readonly variable NSLD: Swift bridging header '*-Swift.h' not found under '/Users/felixkrautschuk/Library/Developer/Xcode/DerivedData/temp-dbidsewoqzobuxfttclgflqmtwxh/Build/Intermediates.noindex/temp.build/Debug-iphonesimulator/temp.build/Objects-normal/x86_64' Generating metadata...~/Downloads/temp/platforms/ios/internal/metadata-generator/bin ~/Downloads/temp/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/temp/platforms/ios/build/Debug-iphonesimulator/metadata-x86_64.bin -output-umbrella /Users/felixkrautschuk/Downloads/temp/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.4.sdk -mios-simulator-version-min=9.0 -std=gnu99 -target x86_64-apple-ios13.0-macabi -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/include -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal/Swift-Modules -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/../../App_Resources/iOS/src -I/Users/felixkrautschuk/Downloads/temp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src -F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal/ -F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator -F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization -F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents -F/Users/felixkrautschuk/Downloads/temp/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.4.sdk", "-mios-simulator-version-min=9.0", "-std=gnu99", "-target", "x86_64-apple-ios13.0-macabi", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/include", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization/MDFInternationalization.framework/Headers", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents/MaterialComponents.framework/Headers", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal/Swift-Modules", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/../../App_Resources/iOS/src", "-I/Users/felixkrautschuk/Downloads/temp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios/src", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/internal/", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/MaterialComponents", "-F/Users/felixkrautschuk/Downloads/temp/platforms/ios/../../node_modules/@nativescript/core/platforms/ios", "-DCOCOAPODS=1", "-DDEBUG=1", Merged 818 categories. Result: 45837 declarations from 154 top level modules Done! Running time: 4.97017 sec Saving metadata generation's stderr stream to: /Users/felixkrautschuk/Downloads/temp/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-x86_64.txt ~/Downloads/temp/platforms/ios ld: framework not found TNSWidgets 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 ** BUILD FAILED **Unable to apply changes on device: D4022399-722F-4DC5-92B0-6001474E4A7B. Error is: Command xcodebuild failed with exit code 65.
I have the same problem, did you resolve it ?
same
same issues including dylib.
the same