NativeScript: {N} 7.0.1 adds the wrong iOS 14 frameworks to project

Environment

Describe the bug NativeScript.framework/NativeScript and TKLiveSync.framework/TKLiveSync are compiled with sdk 14.2 so it works on simulators/devices/testflight but if you try to submit for review to the app store it says

ITMS-90512: Invalid sdk value - The value provided for the sdk portion of LC_VERSION_MIN_IPHONEOS in mypackagename.app/Frameworks/NativeScript.framework/NativeScript is 14.2 which is greater than the maximum allowed value of 14.0.

ITMS-90512: Invalid sdk value - The value provided for the sdk portion of LC_VERSION_MIN_IPHONEOS in mypackagename.app/Frameworks/TKLiveSync.framework/TKLiveSync is 14.2 which is greater than the maximum allowed value of 14.0.

To Reproduce Just submit for review an app to the app store

Expected behavior The two frameworks should be built with release sdk not beta

Also here _Originally posted by @eltharynd in https://github.com/NativeScript/NativeScript/issues/8867#issuecomment-703657447_

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 36 (11 by maintainers)

Most upvoted comments

We have pushed a new RC1 – this should solve the upload to Apple issue. We sincerely apology for the issue; somehow the last RC still got built with a XCode Beta even though the Xcode tooling said it was using the XCode GM 12.01.

npm i --save-dev @nativescript/ios@latest

then a

ns clean

You should be good after this…

I was able to find a temporary workaround… I build my own frameworks…

Here’s a simplified step by step

# Clone repo
git clone https://github.com/NativeScript/ns-v8ios-runtime.git

# Install CMake and LLVM (8)
brew install cmake llvm@8

# Open the runtime in XCode
cd ns-v8ios-runtime
open v8ios.xcodeproj

# Update the project to use the 12.0 sdk instead u
Click the yellow xcode warning on the left that asks to update the sdk version and confirm

#If you have an error i just modified it this way cause it wasn't taking it as a single expression
const std::__1::string buffer = std::to_string(i);
const char* name = buffer.c_str();

# Build the device version of frameworks
Select the Nativescript target and any ios device and hit Run (the play button).
Select the TKLiveSync target and any ios device and hit Run (the play button).

#On your project clean the platform and prepare it
tns clean
tns prepare ios --for-device

#Open your workspace with xcode

#on the project general tab remove both frameworks
#Nativescript 
#TKLiveSync 

#Drag v8ios.xcodeproj from its xcode window to your app name on your app xcode window
#this will make your project use your 12.0 compiled frameworks

#Select any ios device, build and then ytou can archive and deploy from xcode and it should work

basically a combination of both https://github.com/NativeScript/ns-v8ios-runtime and https://docs.nativescript.org/core-concepts/ios-runtime/how-to/debug-ios-runtime

as a side note: I’m not still 100% sure it worked but usually after 3 minutes from submitting for review I immediately got the error, it hasn’t so far for about an hour… by usual apple standards i can only be sure about this in 2 days but So far it seems ok… I’ll update if this doesn’t work

We have pushed a new RC1 – this should solve the upload to Apple issue. We sincerely apology for the issue; somehow the last RC still got built with a XCode Beta even though the Xcode tooling said it was using the XCode GM 12.01.

npm i --save-dev @nativescript/ios@latest

then a

ns clean

You should be good after this…

It worked for my app’s submission. Applestore 's not longer reject it with the ITMS-90512 issue. My local env: √ Getting NativeScript components versions information… √ Component nativescript has 7.0.10 version and is up to date. √ Component @nativescript/core has 7.0.10 version and is up to date. √ Component @nativescript/ios has 7.0.2-rc1 version and is up to date. √ Component @nativescript/android has 7.0.0 version and is up to date.

Xcode 12.0.1 MacOS 10.15.7

Same here, built yesterday with the new RC and passed Apple validation today 👍 Thanks guys 🙏

Not sure if this is relevant but

platforms/ios/build/Release-iphoneos/NativeScript.framework/Info.plist platforms/ios/build/Release-iphoneos/TKLiveSync.framework/Info.plist

… and some other files contain a DTPlatformVersion = 14.2

Edit: these files origin from node_modules/@nativescript/ios/framework/internal/XCFrameworks.zip

We were still unable to review your app as it crashed on launch. We have attached detailed crash logs to help troubleshoot this issue.

… it didn’t crash on emulator, it didn’t crash on phisical devices… a user has been using it daily with no crashes…

I. fing. hate. apple.

@eltharynd thanks for looking into this - will be publishing a fixed version tomorrow!

I was facing this issue on @nativescript/ios@7.0.1 (with CLI v7.0.10 and Xcode 12.0.1). I can confirm that @nativescript/ios@7.0.3 fixes it.

@NathanaelA walked me through the steps to update to @nativescript/ios@7.0.3. Simply installing the latest via npm install @nativescript/ios@latest is not sufficient, as it’s rather aggressively cached (or something along those lines). You have to do a clean build.

Here’s my terminal history for doing a clean build with the latest iOS runtime:

rm -rf platforms/ios
# Removing `node_modules/@nativescript/ios` would be sufficient, but
# I decided I might as well re-install all my node modules while I was at it.
rm -rf node_modules
rm package-lock.json
tns platform add ios@7.0.3
npm install
tns run ios --device "iPhone 11 Pro" --no-hmr
# Check it works as intended on the simulator.

I then opened platforms/ios/NSIDE/NSIDE.xcworkspace as usual, cleaned the build folder, and archived for iOS, and it worked.

Now my app is waiting in review, and hasn’t been immediately rejected due to LC_VERSION_MIN_IPHONEOS.

EDIT: My app was accepted!

The new runtime is here

HERE’S THE ULTIMATE GUIDE ON HOW TO SUCCESSFULLY BUILD FOR PUBLISHING

tldr: We’re gonna build and archive our own Nativescript.xcframework and TKLiveSync.xcframework, and embed & sign them in our app…

Clone the runtime repo somewhere git clone https://github.com/NativeScript/ns-v8ios-runtime.git

Install Cmake and LLVM (not really sure if needed but you never know) brew install cmake llvm@8

Open the runtime in xcode

cd ns-v8ios-runtime
open v8ios.xcodeproj

Update the project to use the 12.0 sdk instead Click the yellow xcode warning on the left that asks to update the sdk version and confirm

You will get an error, click on it to get to the file and modify it this way

auto buffer = std::to_string(i);
const char* name = buffer.c_str();

In the runtime folder run the following commands

xcodebuild archive -workspace v8ios.xcworkspace -scheme NativeScript -sdk iphoneos14.0 OBJROOT=build/iOS
xcodebuild -create-xcframework -framework build/iOS/UninstalledProducts/iphoneos/NativeScript.framework -output build/NativeScript.xcframework

xcodebuild archive -workspace v8ios.xcworkspace -scheme TKLiveSync -sdk iphoneos14.0 OBJROOT=build/iOS
xcodebuild -create-xcframework -framework build/iOS/UninstalledProducts/iphoneos/TKLiveSync.framework -output build/TKLiveSync.xcframework

This will build and archive the two Schemes in the .xcframework format

On your project clean everything to be sure there’s no other earlier attemps laying around ns clean Install node packages npm install

Open node_modules/@nativescript/core/ui/core/view-base/index.js and comment out line 456

if (view.parent !== this) {
    //throw new Error('View not added to this instance. View: ' + view + ' CurrentParent: ' + view.parent + ' ExpectedParent: ' + this);
}

This will avoid your app crashing when closing and therefore allow it to pass app store review (altho obv this will have to be fixed)

Prepare the xcode project ns prepare ios --for-device

Open it in xcode, then click on your project name, in the General tab click on your app target and look for Frameworks, Libraries, and Embedded Content There you will find Nativescript.xcframework and TKLiveSync.xcframework. Click on them and hit the minus sign to remove them both.

Click on the plus sign, hit “Add Other…” > “Add Files…” and navigate to the ns-v8ios-runtime/build folder Select Nativescript.xcframework and add it to the project. Do the same for TKLiveSync.xcframework

Make sure both are on “Embed & Sign”

At this point you can Build, Archive and Deploy normally.

notes: I’m pretty sure this solution will work. But as usual, it will take about 2 days for apple to review it and confirm… I’ll keep you posted…

TODO: @nativescript/core should be updated to fix the exception @nativescript/ios should be fixed to build with release sdk instead of 14.2

UPDATE 2020-10-09 10:14 UTC: I don’t know what’s happening to apple but somehow the app is already in review a mere hour after submitting this… I’ll let you know pretty soon the results

UPDATE 2020-10-09 11:41 UTC: App was accepted… (Tbh it was rejected cause they didn’t like something else, but the binary was ok)

@jeremypele and that’s using @nativescript/ios@7.0.2-rc.0?

Tried installing package, and publishing, but same error, will try to clean.

Edit:

Nope same problem:

Dear Developer, We identified one or more issues with a recent submission for App Store review for your app, “***”.

Please correct the following issues, then upload again.

ITMS-90512: Invalid sdk value - The value provided for the sdk portion of LC_VERSION_MIN_IPHONEOS in JKG2.app/Frameworks/NativeScript.framework/NativeScript is 14.2 which is greater than the maximum allowed value of 14.0.
ITMS-90512: Invalid sdk value - The value provided for the sdk portion of LC_VERSION_MIN_IPHONEOS in JKG2.app/Frameworks/TKLiveSync.framework/TKLiveSync is 14.2 which is greater than the maximum allowed value of 14.0.

Best regards, The App Store Team