Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ns build iOS and Xcode build not working after upgrade to xcode 15 #10487

Open
3 tasks done
kfathy-ys opened this issue Jan 31, 2024 · 5 comments
Open
3 tasks done

ns build iOS and Xcode build not working after upgrade to xcode 15 #10487

kfathy-ys opened this issue Jan 31, 2024 · 5 comments

Comments

@kfathy-ys
Copy link

kfathy-ys commented Jan 31, 2024

Issue Description

After i upgrade to xcode 15 , i try to build the project to ios but it return an error :
KeyError: 'DEPLOYMENT_TARGET_CLANG_FLAG_NAME'

Command Ld failed with a nonzero exit code

Reproduction

I build with xcode or using ns build ios

Relevant log output (if applicable)

After i upgrade to xcode 15 , i try to build the project to ios but it return an error :
Ld /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/IPA.app/IPA normal (in target 'IPA' from project 'IPA')

    cd /Users/admin/Documents/ipaPro/IPA/platforms/ios

    /Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/nsld.sh -Xlinker -reproducible -target arm64-apple-ios14.7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk -O0 -L/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/EagerLinkingTBDs/Debug-iphoneos -L/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.2.sdk/usr/lib/swift -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/EagerLinkingTBDs/Debug-iphoneos -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/ -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/BEMCheckBox -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/Cosmos -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/DRCircularProgress -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/FirebaseCore -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/FirebaseCoreDiagnostics -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/FirebaseCrashlytics -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/FirebaseInstallations -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/GoogleDataTransport -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/GoogleUtilities -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/IQKeyboardManager -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/MDFInternationalization -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/MDFTextAccessibility -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/MaterialComponents -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/PromisesObjC -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/QBImagePickerController -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/Toast-Swift -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/iOS-QR-Code-Generator -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/nanopb -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/Pods/FirebaseAnalytics/Frameworks -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/Pods/GoogleAppMeasurement/Frameworks -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/@nativescript/core/platforms/ios -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/@nota/nativescript-webview-ext/platforms/ios -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/nativescript-star-printer/platforms/ios -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/nativescript-ui-autocomplete/platforms/ios -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/nativescript-ui-listview/platforms/ios -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/../../node_modules/nativescript-ui-core/platforms/ios -filelist /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/IPA.build/Debug-iphoneos/IPA.build/Objects-normal/arm64/IPA.LinkFileList -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/IPA.build/Debug-iphoneos/IPA.build/Objects-normal/arm64/IPA_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -ObjC -sectcreate __DATA __TNSMetadata /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/metadata-arm64.bin -framework NativeScript -framework TKLiveSync -F/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal -licucore -lz -lc++ -framework Foundation -framework UIKit -framework CoreGraphics -framework MobileCoreServices -framework Security -ObjC -lc++ -lsqlite3 -lz -framework BEMCheckBox -framework CoreGraphics -framework CoreTelephony -framework Cosmos -framework DRCircularProgress -framework FBLPromises -framework FIRAnalyticsConnector -framework FirebaseAnalytics -framework FirebaseCore -framework FirebaseCoreDiagnostics -framework FirebaseCrashlytics -framework FirebaseInstallations -framework Foundation -framework GoogleAppMeasurement -framework GoogleDataTransport -framework GoogleUtilities -framework IQKeyboardManager -framework MDFInternationalization -framework MDFTextAccessibility -framework MaterialComponents -framework Photos -framework QBImagePickerController -framework QuartzCore -framework SafariServices -framework Security -framework StoreKit -framework SystemConfiguration -framework Toast_Swift -framework UIKit -framework iOS_QR_Code_Generator -framework nanopb -framework TNSWidgets -framework NotaWebViewExt -framework StarPrinter -framework TNSAutoComplete -framework TNSListView -framework TNSCore -framework Pods_IPA -Xlinker -no_adhoc_codesign -Xlinker -dependency_info -Xlinker /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/IPA.build/Debug-iphoneos/IPA.build/Objects-normal/arm64/IPA_dependency_info.dat -o /Users/admin/Documents/ipaPro/IPA/platforms/ios/build/Debug-iphoneos/IPA.app/IPA



./.build_env_vars.sh: line 506: declare: UID: readonly variable

NSLD: Swift bridging header '*-Swift.h' not found under '/Users/admin/Documents/ipaPro/IPA/platforms/ios/build/IPA.build/Debug-iphoneos/IPA.build/Objects-normal/arm64'

Generating metadata...~/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin ~/Documents/ipaPro/IPA/platforms/ios

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:57: SyntaxWarning: "is" with a literal. Did you mean "=="?

  if effective_platofrm_name is "-macosx":

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:59: SyntaxWarning: "is" with a literal. Did you mean "=="?

  elif effective_platofrm_name is "-watchos" or effective_platofrm_name is "-watchsimulator":

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:59: SyntaxWarning: "is" with a literal. Did you mean "=="?

  elif effective_platofrm_name is "-watchos" or effective_platofrm_name is "-watchsimulator":

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="?

  elif effective_platofrm_name is "-appletvos" or effective_platofrm_name is "-appletvsimulator":

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:61: SyntaxWarning: "is" with a literal. Did you mean "=="?

  elif effective_platofrm_name is "-appletvos" or effective_platofrm_name is "-appletvsimulator":

/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py:115: SyntaxWarning: "is" with a literal. Did you mean "=="?

  if env_or_empty("IS_UIKITFORMAC").capitalize() is "YES":

Python version: 3.9.6 (default, Nov 10 2023, 13:38:27) 

[Clang 15.0.0 (clang-1500.1.0.2.5)]

Traceback (most recent call last):

  File "/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py", line 41, in <module>

    deployment_target_flag_name = env("DEPLOYMENT_TARGET_CLANG_FLAG_NAME")

  File "/Users/admin/Documents/ipaPro/IPA/platforms/ios/internal/metadata-generator-x86_64/bin/./build-step-metadata-generator.py", line 14, in env

    return os.environ[env_name]

  File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/os.py", line 679, in __getitem__

    raise KeyError(key) from None

KeyError: 'DEPLOYMENT_TARGET_CLANG_FLAG_NAME'

Command Ld failed with a nonzero exit code

Environment

npx: installed 3 in 6.235s

OS: macOS 14.2.1

CPU: (4) x64 Intel(R) Core(TM) i7-8700B CPU @ 3.20GHz

Shell: /bin/bash

node: 12.18.3

npm: 6.14.6

nativescript: 8.0.2



# android

java: 1.8.0_282

ndk: Not Found

apis: 30

build_tools: 30.0.3

system_images: 

  - android-30 | Google APIs Intel x86 Atom



# ios

xcode: 15.1/15C65

cocoapods: 1.14.3

python: 3.9.6

python3: 3.9.6

ruby: 2.6.10

platforms: 

  - DriverKit 23.2

  - iOS 17.2

  - macOS 14.2

  - tvOS 17.2

  - watchOS 10.2

Dependencies

"dependencies": {

  "@angular/animations": "~12.0.0",

  "@angular/common": "~12.0.0",

  "@angular/compiler": "~12.0.0",

  "@angular/core": "~12.0.0",

  "@angular/forms": "~12.0.0",

  "@angular/http": "^7.2.16",

  "@angular/platform-browser": "~12.0.0",

  "@angular/platform-browser-dynamic": "~12.0.0",

  "@angular/router": "~12.0.0",

  "@capacitor/core": "^5.5.1",

  "@fortawesome/fontawesome-free": "^5.15.4",

  "@nativescript-community/ui-material-core": "^6.2.5",

  "@nativescript-community/ui-material-slider": "^6.2.5",

  "@nativescript-community/ui-material-tabs": "^6.2.5",

  "@nativescript/angular": "~12.0.0",

  "@nativescript/animated-circle": "^1.1.7",

  "@nativescript/core": "~8.0.0",

  "@nativescript/datetimepicker": "^2.1.9",

  "@nativescript/fingerprint-auth": "^8.1.0",

  "@nativescript/firebase": "^11.1.3",

  "@nativescript/imagepicker": "^1.0.6",

  "@nativescript/localize": "~5.0.4",

  "@nativescript/payments": "^1.0.4",

  "@nativescript/schematics": "^11.2.0",

  "@nativescript/social-share": "^2.0.4",

  "@nativescript/theme": "~3.0.1",

  "@nota/nativescript-webview-ext": "^8.0.0",

  "@nstudio/nativescript-checkbox": "^2.0.4",

  "@triniwiz/nativescript-star-ratings": "^2.0.3",

  "capacitor-block-screen-capture": "0.0.6",

  "country-data": "0.0.31",

  "g": "^2.0.1",

  "intl": "^1.2.5",

  "nativescript": "8.0.2",

  "nativescript-angular-cli": "^0.1.9",

  "nativescript-appurl": "^1.3.5",

  "nativescript-drop-down": "^6.0.0",

  "nativescript-in-app-purchase": "^2.1.0",

  "nativescript-inappbrowser": "^3.1.2",

  "nativescript-iqkeyboardmanager": "^1.5.1",

  "nativescript-pdfview-ng": "^2.0.1",

  "nativescript-printer": "^3.0.0",

  "nativescript-qr-generator": "^3.0.0",

  "nativescript-star-printer": "^4.2.1",

  "nativescript-star-ratings": "^1.0.0",

  "nativescript-store-ratings": "^1.0.0",

  "nativescript-toasty-ns-7": "^14.0.0",

  "nativescript-ui-autocomplete": "^8.0.0",

  "nativescript-ui-listview": "~10.0.0",

  "nativescript-windowed-modal": "^7.0.0",

  "rxjs": "^6.6.0",

  "semver": "^7.3.5",

  "util": "^0.12.5",

  "zone.js": "~0.11.4"

},

"devDependencies": {

  "@angular/compiler-cli": "~12.0.0",

  "@nativescript/android": "8.0.0",

  "@nativescript/ios": "8.0.0",

  "@nativescript/types": "~8.0.0",

  "@nativescript/webpack": "beta",

  "@ngtools/webpack": "~12.0.0",

  "typescript": "~4.2.0"

}

Please accept these terms

@kfathy-ys kfathy-ys added the bug-pending-triage Reported bug, pending triage to confirm. label Jan 31, 2024
@rigor789
Copy link
Member

I believe this would be fixed by updating the ios runtime:

"@nativescript/ios": "8.0.0",

Try upgrading that to 8.6.3.

@rigor789 rigor789 removed the bug-pending-triage Reported bug, pending triage to confirm. label Jan 31, 2024
@dschewchenko
Copy link

Yep. Because ~ prefix will respect only patch updates, which in nativescript are just bugfix or polish without breaking compatibility (by semver)
Use ^ to be up-to-date with minor updates of nativescript modules, usually it will not break your app on update =)

@kfathy-ys
Copy link
Author

kfathy-ys commented Feb 3, 2024

Thank you @rigor789 and @dschewchenko for your reply.
Now the project build successfully but when start it return the following error:
untime initialization took 296ms (version 8.6.3, V8 version 10.3.22)

CONSOLE LOG: Loading inspector modules...
CONSOLE LOG: Finished loading inspector modules.
***** Fatal JavaScript exception - application has been terminated. *****
NativeScript encountered a fatal error:

Error calling module function
TypeError: Cannot read properties of undefined (reading 'env')
File: (file:///app/vendor.js:171335:19)

StackTrace:
./node_modules/util/util.js(file:///app/vendor.js:171335:20)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/object-inspect/util.inspect.js(file:///app/vendor.js:157255:18)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/object-inspect/index.js(file:///app/vendor.js:156791:19)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/side-channel/index.js(file:///app/vendor.js:168363:15)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/qs/lib/stringify.js(file:///app/vendor.js:158483:22)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/qs/lib/index.js(file:///app/vendor.js:158192:17)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/url/url.js(file:///app/vendor.js:170199:17)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/@nota/nativescript-webview-ext/webview-ext-common.js(file:///app/vendor.js:130656:61)
at webpack_require(file:///app/runtime.js:23:41)
at ./node_modules/@nota/nativescript-webview-ext/webview-ext.ios.js(file:///app/vendor.js:131548:77)
at webpack_require(file:///app/runtime.js:23:41)
at ./src/app/account/register/register.component.ts(file:///app/bundle.js:3094:88)
at webpack_require(file:///app/runtime.js:23:41)
at ./src/app/app-routing.module.ts(file:///app/bundle.js:4097:94)
at webpack_require(file:///app/runtime.js:23:41)
at ./src/app/app.module.ts(file:///app/bundle.js:4437:77)
at webpack_require(file:///app/runtime.js:23:41)
at ./src/main.ts(file:///app/bundle.js:33:73)
at webpack_require(file:///app/runtime.js:23:41)
at webpack_exec(file:///app/bundle.js:33584:39)
at (file:///app/bundle.js:33585:111)
at webpack_require.X(file:///app/runtime.js:102:21)
at (file:///app/bundle.js:33585:47)
at (file:///app/bundle.js:33590:3)
at require(:1:232)

@kfathy-ys kfathy-ys closed this as not planned Won't fix, can't repro, duplicate, stale Feb 3, 2024
@kfathy-ys kfathy-ys reopened this Feb 3, 2024
@dschewchenko
Copy link

it looks like you are trying to read process.env. And process.env.SomeEnv has not been replaced by webpack. Add debug; or console.log before this line and check. Check webpack configuration for working with env variables passed to runtime

@kfathy-ys
Copy link
Author

I didn't use process.env I just import environment and this webpack file
const webpack = require("@nativescript/webpack");

module.exports = (env) => {
webpack.init(env);

// Learn how to customize:
// https://docs.nativescript.org/webpack

return webpack.resolveConfig();

};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants