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

TARGETED_DEVICE_FAMILY not respected with NS7 #5733

Closed
maxorlovsky opened this issue Mar 24, 2021 · 7 comments · Fixed by NativeScript/ios#211
Closed

TARGETED_DEVICE_FAMILY not respected with NS7 #5733

maxorlovsky opened this issue Mar 24, 2021 · 7 comments · Fixed by NativeScript/ios#211
Milestone

Comments

@maxorlovsky
Copy link

maxorlovsky commented Mar 24, 2021

Environment
✔ Getting NativeScript components versions information...
✔ Component nativescript has 7.2.1 version and is up to date.
⚠ Update available for component @nativescript/core. Your current version is 7.1.4 and the latest available version is 7.3.0.
⚠ Update available for component @nativescript/ios. Your current version is 7.1.1 and the latest available version is 7.2.0.
✔ Component @nativescript/android has 7.0.1 version and is up to date.

Describe the bug
TARGETED_DEVICE_FAMILY in build.xcconfig worked with NS6, with NS7 it seems to be ignored as in project files of iOS it is set to TARGETED_DEVICE_FAMILY = "1,2";

To Reproduce
Just build the app and open xproj files or project in xcode

Expected behavior
Project is targeting one device that specified.

@azriel46d
Copy link

azriel46d commented Apr 14, 2021

Have the same issue.
The workaround i used is the following (am using fastlane as well for this as part of my uploading to testflight)

sed -i '' 's/TARGETED_DEVICE_FAMILY = \"1,2\";/TARGETED_DEVICE_FAMILY = 1;/g' <PATH TO YOUR>.xcodeproj/project.pbxproj

see https://gist.github.com/anhtuank7c/63e799e2cbc9ccc1dcb84709f618f1d9#file-fastfile-L112

@pfumagalli
Copy link
Contributor

Same here on NS8.

Simple build to reproduce:

  • ns create foo (using Plain TypeScript, template Hello, World)
  • add TARGETED_DEVICE_FAMILY=1 to ./App_Resources/iOS/build.xcconfig
  • ns run

The TARGETED_DEVICE_FAMILY variable falls back to 1,2.

@pfumagalli
Copy link
Contributor

If it helps, in my Podfile I added (as above)

system('sed -i "" "s|TARGETED_DEVICE_FAMILY = \"1,2\";|TARGETED_DEVICE_FAMILY = 1;|g" myapp.xcodeproj/project.pbxproj')

This needs to be specified outside of any pre_install or post_install blocks, otherwise the .pbxproj file will be overwritten by the pods installation process.

Obviously, above, the reference to myapp.xcodeproj/project.pbxproj needs to be adjusted to whatever your main .pbxproj file is...

@SergeyMell
Copy link

Confirm that this issue still exists on 8.1.4 version

@SmailHammour
Copy link

Still an issue in v8.4.0. @NathanWalker is this going to be fixed any time soon?

@NathanWalker NathanWalker transferred this issue from NativeScript/NativeScript Apr 13, 2023
@NathanWalker
Copy link
Contributor

NathanWalker commented Apr 13, 2023

@SmailHammour I moved this to CLI and put on 8.6 milestone to clear - possible we may be able to clear in a patch though.

@NathanWalker NathanWalker added this to the 8.6 milestone Apr 13, 2023
@edusperoni
Copy link
Collaborator

maybe it's the same case as this: #5728

I think we might need to reconsider the build.xcconfig merge strategy @rigor789

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

Successfully merging a pull request may close this issue.

7 participants