nativescript 5.1 and tns_modules folder in IOS build

北战南征 提交于 2019-12-13 03:56:37

问题


I had this issue before with some app (N 4.1). Now i'm doing another app, and i have the same issue : First, im preparing build:

tns build ios --for-device --release --provision MY_Provision

Nativescript is doing build, so next i'm opening it in XCode, and doing some twaks like version number etc... Lastly i'm doing "Archieve" and trying to Validate this archieve. The result is error, in the previous app written in N 4.1 i had the same but with another plugin, and now validation throws: Invalid build structure - binary app/rns_modules.fstevents.lib/binding/Release/FILE NAME. many errors regarding this folder. So i've just removed this directory and done another archieve and validation - app passed the validation.

So, my question is - do i need such number of plugins in tns_modules ? Or better question - is there any way to determine what is not needed ? Or, am i doing something wrong when building an app ? As seems massive number of directories here and i'm wondering if maybe there is some kind of cleanup or something ?

For now, the only way to store an app is to validate first, check what is blocking validation, delete this, check if app works (:() and try again. Thank you.

Below, attached, folder that is blocking validation and amount of dirs inside of tns_modules.

pacakge.json:


回答1:


NativeScript CLI will prepare (i.e. copy) all packages declared in the dependencies section of your package.json (and their dependencies) in tns_modules. All devDependencies and their dependencies will not be copied to the native Xcode/Android Studio project. So, all packages that are required only for building the application, should be installed as devDependencies. For example, such packages are nativescript-dev-webpack, nativescript-dev-typescript, etc. Also, it looks like you have installed NativeScript CLI as a dependency of your project. By default, it should be installed globally, i.e. npm i -g nativescript. In case you omit the -g flag, npm will install it as dependency of your project. You can try:

rm -rf platforms
npm un --save nativescript

Check package.json for other packages with -dev in their names and ensure they are in the devDependencies section.

After that run tns build ios --forDevice.



来源:https://stackoverflow.com/questions/54512390/nativescript-5-1-and-tns-modules-folder-in-ios-build

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!