I'm on MacOS platform now and did a full install of the tools for {N}.
I can build my app. I see it being installed on the emulator and can also see the splash screen and then crash.
** BUILD SUCCEEDED **
Project successfully built
Successfully deployed on device with identifier '7E5B1A70-9579-4510-8279-E43522B8537C'.
1 0x107ee05dc -[TNSRuntime executeModule:referredBy:]
2 0x107a0f4e2 main
Jan 16 15:09:50 macs-iMac test4[2821]: 3 0x10d72a68d start
4 0x1
[native code]: JS ERROR NSErrorWrapper: The data couldn’t be read because it isn’t in the correct format.
Jan 16 15:09:50 macs-iMac com.apple.CoreSimulator.SimDevice.7E5B1A70-9579-4510-8279-E43522B8537C.launchd_sim[2436] (UIKitApplication:org.nativescript.test4[0x3494][2821]): Service exited due to Segmentation fault: 11
Any help???
The app runs fine on Android.
I also download the groceries app on macOS and it builds and runs ok - just wanted to make sure the tools were installed properly.
I see the culprit is JS ERROR NSErrorWrapper: The data couldn’t be read because it isn’t in the correct format.
How can I find out what that could be???
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.test4",
"tns-ios": {
"version": "2.4.0"
}
},
"dependencies": {
"nativescript-calendar": "^1.2.0",
"nativescript-email": "^1.3.4",
"nativescript-imagepicker": "^2.4.1",
"nativescript-phone": "^1.2.3",
"nativescript-purchase": "^1.0.1",
"nativescript-telerik-ui": "^1.5.1",
"nativescript-theme-core": "^0.2.5",
"nativescript-themes": "^1.1.0",
"nativescript-toast": "^1.4.3",
"tns-core-modules": "^2.4.4"
},
"devDependencies": {
"babel-traverse": "6.19.0",
"babel-types": "6.19.0",
"babylon": "6.14.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.3.0",
"nativescript-dev-sass": "^0.4.1",
"typescript": "^1.8.10"
}
}
Ok found the problem.
<Page.actionBar>
<ActionBar class="action-bar">
<android>
<GridLayout rows="auto" columns="auto,*,auto,auto">
<Label row="0" col="0" text="test"></Label>
</GridLayout>
</android>
<ios>
</ios>
</ActionBar>
</Page.actionBar>
I hadn't defined something for iOS action-bar - that was causing the segmentation fault.
Yes I was planning to add it once I got to the Mac platform.
A simple error message would have been nice.
Related
I have 10 xml files, and 23 js files, and 1 css file
4 font styles, 25 10kb images. Thats all
my app folder size is 2.77 mb
these are the dependencies
{
"nativescript": {
"id": "org.nativescript.higherstudy",
"tns-android": {
"version": "6.3.0"
},
"tns-ios": {
"version": "6.3.0"
}
},
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"#nativescript/theme": "~2.2.1",
"#nstudio/nativescript-floatingactionbutton": "^1.1.0",
"#nstudio/nativescript-loading-indicator": "^2.0.0",
"nativescript-carousel": "^6.1.1",
"nativescript-pdf-view": "^2.1.0",
"nativescript-permissions": "^1.3.8",
"nativescript-phone": "^1.4.1",
"nativescript-toast": "^2.0.0",
"nativescript-ui-listview": "^8.0.1",
"tns-core-modules": "~6.3.0"
},
"devDependencies": {
"nativescript-dev-webpack": "~1.4.0"
},
"gitHead": "94f487c5279f7abc2cc61cb48e357d1756865a40",
"readme": "NativeScript Application"
}
when i build the app on Sidekick the size of apk file is 43,873kb which is 43mb
each time when i add xml js file the size was growing with a range of 5 to 8 mb in size.
is it time to stop using nativescript who will download my simple app with big size.
the problem video link https://youtu.be/FtcbagvDqR8
My Nativescript-Vue project has stopped working without reason, i don't know why.
The gradle build is crashing with this error :
D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
I don't know anything about native android developpment with java so i'm struggling with this error since many hours ..
Here is my app.graddle
apply plugin: "com.android.application"
apply plugin: "com.google.gms.google-services"
dependencies {
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support' && requested.name != 'multidex' ) {
details.useVersion '27.1.1'
}
}
}
}
dependencies {
implementation 'org.slf4j:slf4j-nop:1.7.25'
}
android {
defaultConfig {
multiDexEnabled true
generatedDensities = []
applicationId = "org.nativescript.application"
project.ext {
googlePlayServicesVersion = "+"
}
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
and my package.json in case of this error is caused by one nativescript-plugin, which is what I think :
{
"name": "app",
"version": "1.21",
"license": "MIT",
"nativescript": {
"id": "org.nativescript.application",
"tns-ios": {
"version": "5.3.1"
},
"tns-android": {
"version": "5.3.1"
}
},
"scripts": {
"dev:android": "tns debug android --bundle",
"dev:ios": "tns debug ios --bundle",
"lint": "eslint --ext .js,.vue .",
"run:android": "tns run android --bundle",
"run:ios": "tns run ios --bundle",
"clean": "tns platform clean ios; tns platform clean android"
},
"dependencies": {
"axios": "^0.18.0",
"dotenv-webpack": "^1.7.0",
"nativescript": "^5.2.4",
"nativescript-applozic-chat": "^1.2.4",
"nativescript-appversion": "^1.4.1",
"nativescript-barcodescanner": "^3.0.3",
"nativescript-camera": "^4.2.0",
"nativescript-cardview": "^3.1.1",
"nativescript-checkbox": "^3.0.3",
"nativescript-floatingactionbutton": "^5.0.0",
"nativescript-geolocation": "^4.4.2",
"nativescript-google-maps-sdk": "^2.7.0",
"nativescript-google-places-autocomplete": "^1.0.3",
"nativescript-iqkeyboardmanager": "^1.4.0",
"nativescript-keyboard-toolbar": "^1.0.4",
"nativescript-laravel-echo": "^1.0.1",
"nativescript-lottie": "^3.0.2",
"nativescript-modal-datetimepicker": "^1.1.12",
"nativescript-oauth2": "^1.4.1",
"nativescript-pager": "^9.3.14",
"nativescript-phone": "^1.4.0",
"nativescript-plugin-firebase": "^8.1.1",
"nativescript-plugin-gplaces": "^2.4.6",
"nativescript-vue": "^2.0.0",
"nativescript-websockets": "^1.5.3",
"nativescript-windowed-modal": "^5.0.6",
"promise.prototype.finally": "^3.1.0",
"pusher-nativescript": "^1.0.0",
"tns-android": "^5.2.1",
"tns-core-modules": "^5.2.2",
"tns-ios": "^5.2.0",
"ts-loader": "^5.3.3",
"vue-i18n": "^8.9.0",
"vuelidate": "^0.7.4",
"vuex": "^3.0.1"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.4.4",
"#babel/preset-env": "^7.0.0",
"#vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.2",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"base-64": "^0.1.0",
"clean-webpack-plugin": "^1.0.1",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"date-fns": "^1.30.1",
"eslint": "^5.12.1",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-vue": "^5.1.0",
"lazy": "1.0.11",
"lodash": "^4.17.11",
"nativescript-dev-typescript": "^0.9.0",
"nativescript-dev-webpack": "^0.21.0-next-2019-02-15-084520-01",
"nativescript-image-cache-it": "^4.1.2",
"nativescript-vue-template-compiler": "^2.0.0",
"node-sass": "^4.9.2",
"prettier": "^1.16.1",
"sass-loader": "^7.1.0",
"terser-webpack-plugin": "^1.1.0",
"tns-platform-declarations": "^5.2.2",
"utf8": "^3.0.0",
"vue-loader": "^15.2.6",
"webpack": "^4.16.4",
"webpack-bundle-analyzer": "~3.0.4",
"webpack-cli": "^3.1.0"
}
}
I tried multiple things :
rm -rf hooks/ platforms/ node_modules/ package-lock.json and recompile the whole project
remove the whole .gradle directory in C:/Users/username/ and recompile
uninstall java, and nativescript cli ( tns ) that is globally install, reinstall and recompile
uninstall android-sdk installed with chocolatey in C:/Android, as asked in the nativescript doc, and recompile
tns platform clean android
reclone my project and try to recompile
I'm so desperate that I also created a docker image for nativescript-vue and android to be sure that the error is not related to my computer configuration/environnement, and the error is still here ...
I tried to compile a blank project created with :
vue init nativescript-vue/vue-cli-template
And it's working.
Also, my coworkers can compile the project so it's incomprehensible. My project is the same as theirs, i recloned the project to be sure and they have no not commited files...
I found that the error was caused by this package : "nativescript-google-maps-sdk". Maybe one of the only that i havn't uninstall to see if it was responsible of this error....
Anyway, you can found how i resolved this issue here :
https://github.com/dapriett/nativescript-google-maps-sdk/issues/345#issuecomment-503321201
I'm using NS 2.3.0 and when I start tns run android (and iOS too), there is an error that says:
Processing node_modules failed. SyntaxError:/Users/ledinh/Smarp/node_modules/npm/node_modules/read-package-tree/test/fixtures/empty/node_modules/foo/package.json: Unexpected end of input
This was actually happening to me since 2.2, updating to 2.3 does not solve problem. Even the tns doctor said that no issues were detected. Any help would be much appreciated.
EDIT: Here is my package.json
{
"devDependencies": {
"babel-traverse": "6.15.0",
"babel-types": "6.15.0",
"babylon": "6.9.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.2.3",
"typescript": "^1.7.5"
},
"nativescript": {
"id": "com.smarpsocial.smarpshare",
"tns-ios": {
"version": "2.3.0"
},
"tns-android": {
"version": "2.3.0"
}
},
"scripts": {
"dummy": "echo yay",
"ios": "xcproj --project platforms/ios/SmarpShare.xcodeproj touch; xcproj --project platforms/ios/Pods/Pods.xcodeproj touch; tns livesync ios --emulator --watch",
"test-json-schema": "echo 'Not yet implemented';exit 1;"
},
"dependencies": {
"app-data": "file:setup_assets/plugins/app-data",
"jed": "1.1.0",
"moment": "^2.10.6",
"nativescript-appversion": "^1.1.2",
"nativescript-appwidget": "file:setup_assets/plugins/nativescript-appwidget",
"nativescript-clipboard": "^1.1.3",
"nativescript-facebook-login": "^0.2.0",
"nativescript-fresco": "file:setup_assets/plugins/nativescript-fresco",
"nativescript-iqkeyboardmanager": "^1.0.1",
"nativescript-logEntries": "^1.0.0",
"nativescript-pulltorefresh": "^1.1.0",
"nativescript-push-notifications": "0.0.15",
"nativescript-snackbar": "^1.0.3",
"nativescript-timedatepicker": "file:setup_assets/plugins/timedatepicker",
"nativescript-zendesk": "file:setup_assets/plugins/nativescript-zendesk",
"simple-text-parser": "1.0.0",
"tns-core-modules": "^2.3.0",
"util": "~0.10.3"
}
}
EDIT 2: I created a sample app and it works, but not for my app
I suspect it's because the platforms / tns-core-modules packages in your app have a lower version than what's specified in package.json.
Can you try following these instructions? So:
$ tns platform remove android
$ tns platform add android
$ tns platform remove ios
$ tns platform add android
$ npm install tns-core-modules#latest --save
Recently I've updated my NativeScript CLI to 2.1.0 & installed Telerik UI plugin. After that. my app build getting fail with the error "actual and formal argument lists differ in length".
Screenshot -
package.json
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.bhramaan",
"tns-android": {
"version": "2.1.1"
}
},
"dependencies": {
"#angular/common": "2.0.0-rc.1",
"#angular/compiler": "2.0.0-rc.1",
"#angular/core": "2.0.0-rc.1",
"#angular/http": "2.0.0-rc.1",
"#angular/platform-browser": "2.0.0-rc.1",
"#angular/platform-browser-dynamic": "2.0.0-rc.1",
"#angular/platform-server": "2.0.0-rc.1",
"#angular/router-deprecated": "2.0.0-rc.1",
"nativescript-angular": "0.1.1",
"nativescript-plugin-firebase": "^3.0.1",
"tns-core-modules": "^2.0.0"
},
"devDependencies": {
"babel-traverse": "6.9.0",
"babel-types": "6.9.0",
"babylon": "6.8.0",
"filewalker": "0.1.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^1.8.10"
}
}
I've also removed platform & added once again. But, still now no luck.
Here is your problem:
"tns-android": {
"version": "2.1.1"
}
"tns-core-modules": "^2.0.0"
You must have TNS/NativeScript-CLI, TNS-Common-Core and the TNS-Platforms the same version.
Type: tns info to easily see what versions you are.
Here are the upgrade steps:
To upgrade NativeScript command line
npm install -g nativescript#latest
To Upgrade the NativeScript Common Core library
npm install tns-core-modules#latest --save
To Upgrade the platform (replace android with ios for iOS)
tns platform remove android
tns platform add android
I'm building a NativeScript app. For implementing Drawer, I'm trying to use 'Telerik NativeScript UI' plugin. But, something is not working after installing the plugin & my NativeScript build is getting failed.
Here are 2 screenshots of the build failed.
My package.json file content
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.testapp",
"tns-android": {
"version": "2.0.0"
}
},
"dependencies": {
"#angular/common": "2.0.0-rc.1",
"#angular/compiler": "2.0.0-rc.1",
"#angular/core": "2.0.0-rc.1",
"#angular/platform-browser": "2.0.0-rc.1",
"#angular/platform-browser-dynamic": "2.0.0-rc.1",
"#angular/platform-server": "2.0.0-rc.1",
"#angular/router-deprecated": "2.0.0-rc.1",
"nativescript-angular": "0.1.1",
"nativescript-telerik-ui": "^1.1.1",
"tns-core-modules": "^2.0.0"
},
"devDependencies": {
"babel-traverse": "6.9.0",
"babel-types": "6.10.2",
"babylon": "6.8.1",
"filewalker": "0.1.2",
"lazy": "1.0.11",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^1.8.10"
}
}
My NativeScript CLI version is 2.0.1
Any idea, what's probably going wrong ?
-------It's fixed-------
The solution is, after getting the error..
Don't remove the plugin
Remove the platform(android/ios)
Add the platform once again(android/ios)
Rebuild the app
Try
platform remove android
and then
platform add android
tns run android
I have had this issue every time I try to add a new plugin to nativescript (e.g the phone, telerik-UI, and contact plugins). What worked for me was just navigating into platform > android and then running gradlew clean. This way you wouldn't have to re-add the android platform every time you add a plugin.