Skip to content

Not able to change IPHONEOS_DEPLOYMENT_TARGET due to CLI overwriting ARCHS and VALID_ARCHS #4197

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

Closed
NickIliev opened this issue Dec 4, 2018 · 2 comments

Comments

@NickIliev
Copy link
Contributor

NickIliev commented Dec 4, 2018

When trying to change the iOS deployment target version to 11.0 the build is failing due to the CLI overwriting the VALID_ARCHS and ARCHS here (simulator logic) and here (device logic)

"ARCHS=i386 x86_64",
"VALID_ARCHS=i386 x86_64",

Steps to reproduce the issue:

  • tns create testApp --ng

  • cd testApp

  • Place the following App_Resources/iOS/build.xcconfig

 IPHONEOS_DEPLOYMENT_TARGET = 11.0; 
  • Run
tns build ios

As a result, the build will fail with

Building project...
Xcode build...
warning: The i386 architecture is deprecated for your deployment target (iOS 11.0). You should update your ARCHS build setting to remove the i386 architecture. (in target 'targetios11')
clang: error: invalid iOS deployment version '-mios-simulator-version-min=11.0', iOS 10 is the maximum deployment target for 32-bit targets [-Winvalid-ios-deployment-target]
note: Using new build systemnote: Planning buildnote: Constructing build description
** BUILD FAILED **

Command xcodebuild failed with exit code 65
@NickIliev NickIliev changed the title Not able to change deployment target version due to CLI overwritting ARCHS and VALID_ARCHS on iOS Not able to change deployment target version due to CLI overwritting ARCHS and VALID_ARCHS Dec 4, 2018
@etabakov
Copy link
Contributor

etabakov commented Dec 4, 2018

@DickSmith ☝️

@NickIliev
Copy link
Contributor Author

NickIliev commented Dec 4, 2018

@DickSmith @etabakov as a possible temporary solution, we could change the lib/services/ios-project-service.js file

  • Open the file from your local NativeScript CLI installation e.g. (example path on Mac)
open /usr/local/lib/node_modules/nativescript/lib/services

Inside the services folder locate and open the ios-project-service.js

Modify the VALID_ARCHS and ARCHS for device and simulator builds so that arm7 and i386 are removed

for device builds remove arm7

 const defaultArchitectures = [
    'ARCHS=arm64', , // remove arm7 here
    'VALID_ARCHS=arm64' , // remove arm7 here
]; 

For simulator builds remove i386

return __awaiter(this, void 0, void 0, function* () {
    args = args
        .concat([
        "build",
        "-configuration", buildConfig.release ? "Release" : "Debug",
        "-sdk", "iphonesimulator",
        "ARCHS=x86_64", // remove i386 here
        "VALID_ARCHS=x86_64", , // remove i386 here
         "ONLY_ACTIVE_ARCH=NO",
         "CONFIGURATION_BUILD_DIR=" + path.join(projectRoot, "build", "emulator"),
         "CODE_SIGN_IDENTITY=",
]) 

Then make a clean build for the project with IPHONEOS_DEPLOYMENT_TARGET = 11.0;

@NickIliev NickIliev changed the title Not able to change deployment target version due to CLI overwritting ARCHS and VALID_ARCHS Not able to change IPHONEOS_DEPLOYMENT_TARGET due to CLI overwriting ARCHS and VALID_ARCHS Dec 4, 2018
mbektchiev added a commit to NativeScript/ios-jsc that referenced this issue Dec 4, 2018
The `armv7 arm64` setting is invalid when building for simulator.
The reason for not detecting it until now is that it has been
overridden with a command line argument passed to `xcodebuild`
by {N} CLI.

Doing so however prevents users from specifying their own value
for ARCHS and VALID_ARCHS settings.

See NativeScript/nativescript-cli#4197
@Fatme Fatme added this to the 5.1.0 milestone Dec 4, 2018
@miroslavaivanova miroslavaivanova modified the milestones: 5.1.0, 5.1.1 Dec 10, 2018
@miroslavaivanova miroslavaivanova self-assigned this Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants