Failed to tns build ios due as MDFInternationalization and MaterialComponents directories don't exist
Asked Answered
B

4

2

It works on xCode but not with native script tns. tns build android is fine.

When I execute tns prepare ios && tns build ios I get the error below as those directories don't exist. The Debug-iphonesimulator path does exist with a few other files and a folder inside it but MDFInternationalization and MaterialComponents don't.

Merged 749 categories.
    Result: 43068 declarations from 140 top level modules
Done! Running time: 3.81413 sec
Saving metadata generation's stderr stream to: /Users/sylvester/randd/native-script/platforms/ios/build/Debug-iphonesimulator/metadata-generation-stderr-x86_64.txt
~/randd/native-script/platforms/ios
ld: warning: directory not found for option '-F/Users/sylvester/randd/native-script/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization'
ld: warning: directory not found for option '-F/Users/sylvester/randd/native-script/platforms/ios/build/Debug-iphonesimulator/MaterialComponents'
ld: framework not found MDFInternationalization
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: warning: directory not found for option '-F/Users/sylvester/randd/native-script/platforms/ios/build/Debug-iphonesimulator/MDFInternationalization'
ld: warning: directory not found for option '-F/Users/sylvester/randd/native-script/platforms/ios/build/Debug-iphonesimulator/MaterialComponents'
ld: framework not found MDFInternationalization
clang: error: linker command failed with exit code 1 (use -v to see invocation)
note: Using new build system
note: Planning build
note: Constructing build description
** BUILD FAILED **

Command xcodebuild failed with exit code 65

I tried to build this using xCode and I got a successful build with a working app in the iPhone simulator.

As per my undersatnding at the time of writing this question, it looks like tns is failing to generate these folders.

What am I missing here?

Barquentine answered 22/1, 2020 at 9:38 Comment(2)
same error, but the opposite with me. Running successfully on VS code, but throw exception ld: framework not found MDFInternationalization on Xcode.Macnamara
exact same problem, no help to be found anywhere... NativeScript seems to be one long sequence of pain and punishment !Addlebrained
A
1

Someone has answered this on the NativeScript GitHub Repos:

I found the erro. I was openning the project by the wrong file.

This is usually caused by having the .xcodeproj file open instead of .xcworkspace.

When you run 'pod install' for the first time, it will create an .xcworkspace file, which includes your original .xcodeproj and a Pods project. You'll need to close your .xcodeproj and open the .xcworkspace instead.

This is a common issue when creating a project through Xcode's new project wizard - I often forget that I'm not in a workspace, which is required to get Cocoapods to link correctly.

Build failed - ld: framework not found Pods

Addlebrained answered 12/6, 2020 at 12:23 Comment(0)
I
1

Copy and Paste this in your Pod file

pod 'MDFInternationalization'

post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
end
end
end
Itinerant answered 25/6, 2021 at 14:22 Comment(1)
This solution is life saviour.Unbidden
O
0

I was experiencing the very same issu while trying to build the app with XCode 12. After using xcode-selectto use XCode 11.7 again, to works. Seems like NativeScript 6 is not XCode 12 compatible.

Oringa answered 12/10, 2020 at 9:42 Comment(0)
T
0

This is why I personally hate hybrid apps, but when your head-office tells you to jump, you say how high...

The app I had to support was built on NS6, with Xcode 11. It was crashing on launch on "some" iOS 14 devices, so the fix was to rebuild the app with Xcode 12.

But it kept throwing OP's error.

I resolved this error by upgrading the app's Nativescript packages to the latest "Nativescript 6" version available (I didn't want to do a full upgrade to NS7, because that might have introduced some braking changes).

Based on their own article: https://nativescript.org/blog/nativescript-6-7-xcode-compatibility/

.. I udgraded packages to these versions:

"tns-core-modules": "6.5.20",
"tns-ios": "6.5.3",
"nativescript-dev-webpack": "^1.5.1",

Also, previously to generate and run an optimized release build, I was running:

tns run ios --bundle --env.uglify --env.aot

However, with that, app crashes on start.

So now, to get a release build I run:

tns run ios --release
Td answered 20/10, 2020 at 8:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.