Tns build error: sed: no such file or directory


#1

Hello! Month ago I’ve successfully completed ns tutorial without using angular2. Today I wanted to compete tutorial with NS+angular2. I’ve installed ng-groceries, but it didn’t go well when i did tns run android(iOS). Then I decided to try to check if i can complete just NS groceries tutorial and got the same problem. I have it even with Hello World template. I get the following errors when i do tns run.

For android :
1)

No manifest found in /Users/avmax/sandbox/web/study/tutorials/native-script/HelloWorld/app/App_Resources/Android/AndroidManifest.xml

Execution failed for task ‘:processF0DebugResources’.
com.android.ide.common.process.ProcessException: Failed to execute apt

ENOENT: no such file or directory, scandir ‘/Users/avmax/sandbox/web/study/tutorials/native-script/HelloWorld/app/App_Resources’

For iOS :
1)

ENOENT: no such file or directory, scandir ‘/Users/avmax/sandbox/web/study/tutorials/native-script/HelloWorld/platforms/ios/HelloWorld/Resources’

We have failed to check if we need to add a compatability LaunchScreen.xib due to: Error: ENOENT: no such file or directory, open ‘/Users/avmax/sandbox/web/study/tutorials/native-script/HelloWorld/app/App_Resources/iOS/Info.plist’

tns doctor says :

Your components are up-to-date. No issues were detected.

I have :

tns --version : 2.5.3
nodejs -v: 7.7.3

How can i fix these errors?


#2

Consider invalidating your npm cache, downloading a more recent nativescript version (3.0.1 is already out!), and starting over. It appears to me like the initial project template is messed up - npm can someone download incomplete packages.


#3

Thank you for reply! What do You mean by invalid npm cache? My english is not perfect, google translate did not help me here :smiley: I’ll try tns 3.0.1 in 1h, hope it will help me!


#4

For what i read in your first statement you dont have the AndroidManifest.xml

No manifest found in /Users/avmax/sandbox/web/study/tutorials/native-script/HelloWorld/app/App_Resources/Android/AndroidManifest.xml

Make sure you have this file which is located under app/App_Resources/Android/
Also make sure this file is valid in comparisson to other files.
Here’s mine for example:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
	package="__PACKAGE__"
	android:versionCode="1"
	android:versionName="1.0">

	<supports-screens
		android:smallScreens="true"
		android:normalScreens="true"
		android:largeScreens="true"
		android:xlargeScreens="true"/>

	<uses-sdk
		android:minSdkVersion="17"
		android:targetSdkVersion="__APILEVEL__"/>

	<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
	<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
	<uses-permission android:name="android.permission.INTERNET"/>

	<application
		android:name="com.tns.NativeScriptApplication"
		android:allowBackup="true"
		android:icon="@drawable/icon"
		android:label="@string/app_name"
		android:theme="@style/AppTheme">

		<activity
			android:name="com.tns.NativeScriptActivity"
			android:label="@string/title_activity_kimera"
			android:configChanges="keyboardHidden|orientation|screenSize">

			<intent-filter>
				<action android:name="android.intent.action.MAIN" />
				<category android:name="android.intent.category.LAUNCHER" />
			</intent-filter>
		</activity>
		<activity android:name="com.tns.ErrorReportActivity"/>
	</application>
</manifest>

Tns build stuck on Installing tns-android
#5

npm cache clean will clear your npm downloads and invalidate the cache, forcing packages to be downloaded again from the npm servers, instead being fetched from a local directory on your computer.


#7

your advice worked!! Than you much!!! after cleaning cache, reinstalling tns and reinstalling tutorials by new tns - everything started working. Thank you much!


#8

thanks, but it had to be provided by files I download by downloading tutorial. after changing tns version I got rid of these errors


#9

Glad to hear you were able to move on with your project!