NativeScript / nativescript-cli

Command-line interface for building NativeScript apps
https://www.npmjs.com/package/nativescript
Apache License 2.0
1.04k stars 195 forks source link

[iOS] tns publish runs HMR - results Unexpected CFBundleExecutable Key #4944

Closed yassilah closed 2 years ago

yassilah commented 5 years ago

Environment ✔ Component nativescript has 6.0.3 version and is up to date. ✔ Component tns-core-modules has 6.0.6 version and is up to date. ✔ Component tns-android has 6.0.1 version and is up to date. ✔ Component tns-ios has 6.0.2 version and is up to date.

Describe the bug After migrating to Nativescript 6, I am unable to publish my iOS app. I have tested publishing it through XCode and everything works fine except I eventually get the following error: ITMS-90535: Unexpected CFBundleExecutable Key - The bundle at '/Payload/frontend.app/app/App_Resources/iOS/Info.plist' does not contain a bundle executable.

Using "tns publish ios", I get the following (very strange) error: {"data":null,"messages":{"warn":null,"error":["Unexpected Error"],"info":null},"statusCode":"ERROR"}

What I find strange is that I am perfectly able to run the app both on emulator and on my iPhone (btw great work on ns6, hmr works like a charm ❤️), I simply cannot publish it...

rigor789 commented 5 years ago

I ran into this exact issue very recently. For me the issue was that the App_Resources folder was being copied to the output folder.

I commented out the following section of my webpack.config.js

            // Copy native app resources to out dir.
            new CopyWebpackPlugin([{
                from: `${appResourcesFullPath}/${appResourcesPlatformDir}`,
                to: `${dist}/App_Resources/${appResourcesPlatformDir}`,
                context: projectRoot,
            }]),

With this commented out, the app worked fine, and is now on TestFlight without issues.

I also moved the App_Resources folder out of the app folder, and tweaked the nsconfig.json to accommodate this change, but I don't think that affected the build outcome.

yassilah commented 5 years ago

Yes, thank you! I'm still getting the same error using "tns publish ios" but i can successfully submit my app using XCode. However, I now have another issue, which is that the app crashes right after the launchscreen...

yassilah commented 5 years ago

Ok, for anyone getting that error, I think I found the reason: I'm also using vue-cli-plugin-nativescript-vue and since NS6 brings HMR by default, I had to use tns publish with hmr option set to false:

tns publish ios --hmr=false

Everything works fine now :)

rigor789 commented 5 years ago

I suggest using --release as that will minify the code, and I believe also disable hmr.

tkrevh commented 5 years ago

If anyone is using vue.config.js for webpack config, solution for us was to add: config.plugins.delete('copy-native-resources') in the chainWebpack function.

Lelelo1 commented 4 years ago

I am having the same problem in react-nativescript, also when archiving in Xcode. --hmr=false nor --release helps. I suspect I might have to comment something out in the wepback.config.js as well? @shirakaba

Lelelo1 commented 4 years ago

I moved the info.plist out of the app folder: https://stackoverflow.com/questions/39512387/app-processing-error-unexpected-cfbundleexecutable-key and my build passed. Having made a fairly simple app - there seem to be no implication of having done that.

shirakaba commented 4 years ago

@Lelelo1 thanks for pointing me to this thread. The RNS starter template is forked from the NativeScript Core TS one. I’ll check whether it has the same issue that @rigor789 found (which should probably cover your issue), and address it in the same way if so.

This would mean that the NativeScript Core TS starter template is broken, too! @rosen-vladimirov we might then want to check that the Svelte template isn’t similarly broken.