Closed HenriqueMatias closed 7 years ago
@HenriqueMatias you are mismatching the Android platform version (tns-android 3.0.0.) and the version of your tns-core-modules 2.5.2 along with the used plugins and devDependencies.
As NativeScript 3.0.0 introduced some breaking changes, it is not backward compatible with 2.5.x. So you should either add your Android platform version 2.5.0 or update and migrate the whole project to 3.0.0 (meaning that you will have to set plugin versions compatible with 3.0.0. and also correct any breaking changes that need correction in your code base).
To build your project for 2.5.0 do the following:
rm -rf node_modules
// make sure that the plugin versions in your package.json are compatible with NativeScript 2.5.x
tns platform remove android
tns platform add android@2.5.0
tns build android
Note that with your current package.json some of the plugin's versions are * meaning that they will install the latest published version which might lead to incompatibility if the latest version is migrate for usage with NativeScript 3.0.0. Use hard versioning for project built for NativeScript 2.5.x and below
If you choose to migrate the whole project to 3.0.0 you will need several things:
tns platform add android
Hey thanks @NickIliev ! :)
additionally , i had to run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
now its working on ubuntu. But i would like it works on windows
@HenriqueMatias can you clarify what is the issue you are hitting on Windows?
tns --version
)@HenriqueMatias this error might appear if you do not have the Android SDK installed. Verify that you have installed Android SDK and set the environment variables and let us know if you need further assistance.
It would appear that I have my environment variables, and the latest version of tns-android
and tns-core-modules
installed. I opened Android Studio and updated to the latest sdk. Any ideas why I'm getting this error? (I'm able to run iOS without a problem)
package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.nsWebsurg",
"tns-ios": {
"version": "3.0.1"
}
},
"dependencies": {
"@angular/animations": "~4.2.3",
"@angular/common": "~4.2.3",
"@angular/compiler": "~4.2.3",
"@angular/core": "~4.2.3",
"@angular/forms": "~4.2.3",
"@angular/http": "~4.2.3",
"@angular/platform-browser": "~4.2.3",
"@angular/router": "~4.2.3",
"nativescript-angular": "~3.0.0",
"nativescript-telerik-ui": "^2.0.1",
"nativescript-theme-core": "~1.0.2",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.4.1",
"tns-android": "3.0.1",
"tns-core-modules": "~3.0.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"nativescript-dev-sass": "^1.1.1",
"nativescript-dev-typescript": "~0.4.0",
"node-sass": "*",
"typescript": "~2.3.4"
}
}
.bash_profile
export ANDROID_HOME="${HOME}/Library/Android/sdk"
export PATH="$ANDROID_HOME/tools:$PATH"
export PATH="$ANDROID_HOME/platform-tools:$PATH"
Error:
The plugin tns-android@3.0.1 is already installed TypeError: Path must be a string. Received undefined # run android
Hi @rugdealer
+1 on this issue. Please help.
I ran on the same issue after removing my old android sdk setup that was installed via brew
and then install Android Studio instead. (Mac)
Here is a list of most important things I have done to to fix mine.
Make sure you have the following installed by sdkmanager
to resolve tns doctor
complaints(versions are important):
"platforms;android-25"
"build-tools;25.0.3"
"extras;android;m2repository"
Here is my sdkmanager --list
:
$ $ANDROID_HOME/tools/bin/sdkmanager --list
Installed packages:
Path | Version | Description | Location
------- | ------- | ------- | -------
build-tools;25.0.3 | 25.0.3 | Android SDK Build-Tools 25.0.3 | build-tools/25.0.3/
build-tools;26.0.0 | 26.0.0 | Android SDK Build-Tools 26 | build-tools/26.0.0/
emulator | 26.0.3 | Android Emulator | emulator/
extras;android;m2repository | 47.0.0 | Android Support Repository | extras/android/m2repository/
extras;google;g...e_play_services | 41 | Google Play services | extras/google/g..._play_services/
extras;google;m2repository | 54 | Google Repository | extras/google/m2repository/
extras;intel;Ha...ecution_Manager | 6.1.1 | Intel x86 Emulator Accelerator... | extras/intel/Ha...cution_Manager/
extras;m2reposi...ut-solver;1.0.2 | 1 | Solver for ConstraintLayout 1.0.2 | extras/m2reposi...t-solver/1.0.2/
extras;m2reposi...nt-layout;1.0.2 | 1 | ConstraintLayout for Android 1... | extras/m2reposi...t-layout/1.0.2/
ndk-bundle | 15.0.4075724 | NDK | ndk-bundle/
patcher;v4 | 1 | SDK Patch Applier v4 | patcher/v4/
platform-tools | 26.0.0 | Android SDK Platform-Tools | platform-tools/
platforms;android-25 | 3 | Android SDK Platform 25 | platforms/android-25/
platforms;android-26 | 1 | Android SDK Platform 26 | platforms/android-26/
system-images;a...google_apis;x86 | 4 | Google APIs Intel x86 Atom Sys... | system-images/a...oogle_apis/x86/
tools | 26.0.2 | Android SDK Tools | tools/
tns-android
DOSE NOT belong to dependencies
. It should be under nativescript
. Somehow the build process fail to move tns-android
after adding it as dependencies
.
To fix this, remove it from dependencies
. Then add from tns platform add android
or just tns run android
## ANDROID ##
export PATH=$ANDROID_HOME/tools:$PATH
export PATH=$ANDROID_HOME/platform-tools:$PATH
Hi guys I'm trying to build my app on android. I'm using windows, but i just receive : Path must be a string. Received undefined my package.json is: