Reputation: 555
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:
Upvotes: 0
Views: 173
Reputation: 421
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
.
Upvotes: 3