Closed anaszgh closed 6 years ago
@anaszgh please provide the following information as per the open a new issue guidelines
iOS/Android/Both
tns --version
to fetch it)node_modules/tns-core-modules/package.json
file in your project)"tns-android"
and "tns-ios"
properties in the
package.json
file of your project)package.json
file of your
project)Platform: Android only CLI: 4.0.1 Cross-Platform modules: 4.0.0 Runtime: Android:4.0.0
The problem is that the issue occurs only on thi project, after upgrading it from tns 3.4.1 to tns 4, Creating new project in the cli will build successfully.
@anaszgh check this solution and also consider posting the content of your package.json
Plugin(s): (look for the version number in the package.json file of your
project)
Make sure that your project is rebuilt entirely
rm -rf node_modules platforms hooks
npm i
tns run android
@NickIliev here is the content of package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "com.eventrest.mobile",
"tns-android": {
"version": "4.0.1"
}
},
"dependencies": {
"@angular/animations": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/core": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/router": "~5.2.0",
"nativescript-angular": "~5.2.0",
"nativescript-cardview": "^2.0.5",
"nativescript-carousel": "^3.1.1",
"nativescript-geolocation": "^4.2.6",
"nativescript-grid-view": "^3.4.0",
"nativescript-imagepicker": "^6.0.1",
"nativescript-loading-indicator": "^2.4.0",
"nativescript-push-notifications": "^1.1.3",
"nativescript-secure-storage": "^2.2.2",
"nativescript-snackbar": "^2.0.1",
"nativescript-social-login": "^3.0.8",
"nativescript-social-share": "^1.5.0",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.5.2",
"tns-core-modules": "^4.0.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.6.2"
}
}
I'll try the proposed fix and let you know, Thanks.
Hello @NickIliev
Were you able to reproduce the issue, I have uninstalled android-sdk and installed it again on different path (as advised on slack channel), then i ran tns doctor
with no issues.
Then i have removed the Hooks, Platforms and node_modules folders as advised buy you.
But the issue remains the same when running tns build android
.
@NickIliev i found the issue, and was able to reproduce it on a new application using
tns create {name} --ng
if you Uncomment this section in the app.gradle
// Uncomment to add recyclerview-v7 dependency
dependencies {
compile 'com.android.support:recyclerview-v7:+'
}
you'll face the issue, comment it again and the build succeeds, and please note that this happens only on NativeScript 4
@anaszgh I was able to reproduce the issue with your package.json content and I've noticed that your version of some of the plugins is not updated to the latest. In specific, the plugin nativescript-social-login has released a version 4.0.1 for compatibility with NativeScript 4.0.0. Updating all dependencies to latest has resolved the issue on my test project.
"dependencies": {
"@angular/animations": "~5.2.0",
"@angular/common": "~5.2.0",
"@angular/compiler": "~5.2.0",
"@angular/core": "~5.2.0",
"@angular/forms": "~5.2.0",
"@angular/http": "~5.2.0",
"@angular/platform-browser": "~5.2.0",
"@angular/platform-browser-dynamic": "~5.2.0",
"@angular/router": "~5.2.0",
"nativescript-angular": "~5.3.0",
"nativescript-cardview": "^3.0.1",
"nativescript-carousel": "^3.1.1",
"nativescript-geolocation": "^4.2.6",
"nativescript-grid-view": "^3.4.0",
"nativescript-imagepicker": "^6.0.1",
"nativescript-loading-indicator": "^2.4.0",
"nativescript-push-notifications": "^1.1.3",
"nativescript-secure-storage": "^2.2.2",
"nativescript-snackbar": "^3.0.0",
"nativescript-social-login": "^4.0.1",
"nativescript-social-share": "^1.5.0",
"nativescript-theme-core": "~1.0.4",
"reflect-metadata": "~0.1.8",
"rxjs": "~5.5.2",
"tns-core-modules": "^4.0.0",
"zone.js": "~0.8.2"
},
"devDependencies": {
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"lazy": "1.0.11",
"nativescript-dev-typescript": "~0.6.0",
"typescript": "~2.6.2"
}
You might also need to synchronize the version of com.google.android.gms
as the library is used by multiple plugins and they need to use a single version (otherwise the build will fail with conflict)
@NickIliev Thank you.
Platform: Android OS: MacOS Nativescript Version: 4.0.1
previously i was using NativeScript version 3.4.1 and it was working correctly, regarding some issues i was encouraged to upgrade to version 4, after doing so i keep getting the following build error on
tns build android
Please note that this error appears only on Android builds, IOS works fine