Ionic - Uncaught SyntaxError: Unexpected token On APK - android

I have an error since yesterday I try to fix. I successfully built an android apk using:
ionic cordova build android --prod --release
But the app stuck on white screen on device and emulator (GenyMotion). I inspected the logcat of GenyMotion. I figured out these:
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token )", source: http://localhost/runtime.fcad956485f9614ff8b1.js (1)
> D/SystemWebChromeClient( 5497): http://localhost/polyfills.49d987a1d15d60566c3f.js: Line 1 : Uncaught SyntaxError: Unexpected token =>
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token =>", source: http://localhost/polyfills.49d987a1d15d60566c3f.js (1)
> D/SystemWebChromeClient( 5497): http://localhost/main.2be168d95557cbdc0a3f.js: Line 1 : Uncaught SyntaxError: Unexpected token =>
> I/chromium( 5497): [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected token =>", source: http://localhost/main.2be168d95557cbdc0a3f.js (1)
I don't know why. They are no errors when building.
My package.json
...
"#angular/common": "~12.0.1",
"#angular/core": "~12.0.1",
"#angular/forms": "~12.0.1",
"#angular/platform-browser": "~12.0.1",
"#angular/platform-browser-dynamic": "~12.0.1",
"#ionic/angular": "^5.5.2",
"ionic": "^5.4.16",
"cordova-android": "^9.0.0",
"cordova-browser": "^6.0.0",
"cordova-ios": "^5.1.1",
"cordova-plugin-ionic-webview": "^5.0.0",
...
"#typescript-eslint/eslint-plugin": "4.16.1",
"#typescript-eslint/parser": "4.16.1",
"typescript": "~4.2.4"
My tsconfig.json.
...
"target": "es2015",
"module": "es2020",
"lib": ["es2018", "dom"]
...

After a real battle in order to fix the issue since 3 days,
i solved the problem.
Ionic 5 angular 12 use es2015 as a target when building.
I set "target" to es5 in tsconfig.json and errors in runtime.**.js, polyfills.**.json disappeared
es5 transform ES6 function to standard functions.
More info at
https://www.typescriptlang.org/tsconfig

Here is pretty clear. You have a syntax error. I suppose you can check logs for ionic cordova build android --prod. Probably It will show which files and lines generate these problems.
If you use linter you can try to run npm run lint to check any problems with your code.

ionic + angular has update the type script compiler in the recent update as
Root folder > tcconfig.json > compilerOptions > target > es2020 - This is causing the issue in android version 29
Chang the target as es2015 to resolve the issue

Related

React Native, Execution failed for task ':app:mergeDexDebug'

I'm trying to run my app in physical device but getting that error. I tried to clean gradlew with cd android and ./gradlew clean. I also tried to clean cache but it's giving that error. I just install the react navigation and stack navigation after that I'm getting that error I also tried to reinstall navigation packages but still getting same error. Can anyone help me please? error and package.json is below
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The number of method references in a .dex file cannot exceed 64K.
Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
package.json
"dependencies": {
"#react-native-community/google-signin": "^5.0.0",
"#react-native-community/masked-view": "^0.1.10",
"#react-navigation/native": "^5.8.4",
"#react-navigation/stack": "^5.12.1",
"is_js": "^0.9.0",
"react": "16.13.1",
"react-native": "^0.63.1",
"react-native-fbsdk": "^2.0.0",
"react-native-flash-message": "^0.1.16",
"react-native-gesture-handler": "^1.8.0",
"react-native-localization": "^2.1.6",
"react-native-reanimated": "^1.13.1",
"react-native-safe-area-context": "^3.1.8",
"react-native-screens": "^2.12.0",
"react-native-vector-icons": "^7.1.0",
"react-native-webview": "^10.10.0"
},
According to the Docs
When your app and the libraries it references exceed 65,536 methods, you encounter a build error that indicates your app has reached the limit of the Android build architecture
You may try enabling multiDex to resolve this issue
In your android/app/build.gradle
defaultConfig {
/** ... */
multiDexEnabled true
}
Clean your build and any installed instances in your physical-device as a precaution

Problem migrating to a newer nativescript

I am currently updating my mobile app project from nativescript 5.2.1 to version 6. however trying to run it will always trigger this problem, and i am not sure how to handle it
when i check the code, it seemed it tried to split global.process.version or process.version either in vendor.js or pbkdf2/lib/default-encoding.js
An uncaught Exception occurred on "main" thread.
Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
TypeError: Cannot read property 'split' of undefined
File: (file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:54)
StackTrace:
../node_modules/pbkdf2/lib/default-encoding.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:55)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/lib/sync.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142852:23)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142658:24)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/crypto-browserify/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:58549:9)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/functions.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22025:64)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/init.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22311:68)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20643:70)
at ./app.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20701:30)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at checkDeferredModules(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:44:23)
at webpackJsonpCallback(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:31:19)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:2:57)
at require(:1:266)
TypeError: Cannot read property 'split' of undefined
StackTrace:
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Error calling module function
TypeError: Cannot read property 'split' of undefined
File: (file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:54)
StackTrace:
../node_modules/pbkdf2/lib/default-encoding.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:55)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/lib/sync.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142852:23)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142658:24)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/crypto-browserify/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:58549:9)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/functions.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22025:64)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/init.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22311:68)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20643:70)
at ./app.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20701:30)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at checkDeferredModules(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:44:23)
at webpackJsonpCallback(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:31:19)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:2:57)
at require(:1:266)
TypeError: Cannot read property 'split' of undefined
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6318)
at android.app.ActivityThread.access$1300(ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1867)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:226)
at android.app.ActivityThread.main(ActivityThread.java:7212)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:576)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:956)
Caused by: com.tns.NativeScriptException: Error calling module function
TypeError: Cannot read property 'split' of undefined
File: (file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:54)
StackTrace:
../node_modules/pbkdf2/lib/default-encoding.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142790:55)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/lib/sync.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142852:23)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/pbkdf2/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:142658:24)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ../node_modules/crypto-browserify/index.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/vendor.js:58549:9)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/functions.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22025:64)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at ./global/init.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:22311:68)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at fn(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:121:20)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20643:70)
at ./app.js(file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:20701:30)
at __webpack_require__(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:751:30)
at checkDeferredModules(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:44:23)
at webpackJsonpCallback(file:///data/data/com.ikredo.ikredolenderapp/files/app/runtime.js:31:19)
at (file:///data/data/com.ikredo.ikredolenderapp/files/app/bundle.js:2:57)
at require(:1:266)
TypeError: Cannot read property 'split' of undefined
at com.tns.Runtime.runModule(Native Method)
at com.tns.Runtime.runModule(Runtime.java:674)
at com.tns.Runtime.run(Runtime.java:666)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:21)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6313)
... 8 more
trying to get over the "please add some more details", sorry to look unprofessional but i cannot describe any more detail
Edit:
as requested here is my package.json
{
"nativescript": {
"id": "com.xxxx",
"tns-ios": {
"version": "6.0.1"
},
"tns-android": {
"version": "6.0.0"
}
},
"description": "Lender",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"axios": "^0.18.0",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"nativescript-background-http": "^3.4.0",
"nativescript-camera": "^4.5.0",
"nativescript-cardview": "^3.1.1",
"nativescript-carousel": "^4.1.0",
"nativescript-checkbox": "^3.0.3",
"nativescript-clipboard": "^1.2.0",
"nativescript-datetimepicker": "^1.0.2",
"nativescript-drop-down": "^5.0.0",
"nativescript-fingerprint-auth": "^6.2.0",
"nativescript-imagepicker": "^6.1.2",
"nativescript-iqkeyboardmanager": "^1.4.0",
"nativescript-loading-indicator": "^2.4.0",
"nativescript-lottie": "^3.0.2",
"nativescript-material-bottomsheet": "^2.2.5",
"nativescript-material-ripple": "^2.2.5",
"nativescript-material-textfield": "^2.2.3",
"nativescript-pager": "^9.4.0",
"nativescript-pdf-view": "^2.0.1",
"nativescript-plugin-firebase": "9.0.2",
"nativescript-pulltorefresh": "^2.3.0",
"nativescript-sqlite": "^2.3.3",
"nativescript-statusbar": "^5.0.0",
"nativescript-theme-core": "~1.0.4",
"nativescript-vue": "2.3.0",
"nativescript-web-image-cache": "^5.0.0",
"tns-core-modules": "6.0.1",
"typescript": "^3.7.3"
},
"devDependencies": {
"#babel/core": "~7.1.0",
"#babel/preset-env": "~7.1.0",
"babel-loader": "~8.0.0",
"nativescript-dev-webpack": "1.0.1",
"nativescript-vue-template-compiler": "2.3.0",
"node-sass": "4.12.0",
"vue-loader": "~15.4.0",
"tns-platform-declarations": "6.0.1"
},
"gitHead": "xxx",
"readme": "NativeScript Application",
"maxLogcatObjectSize": 1000000
}
Somewhere, "something" is attempting to perform a split on a string that either doesn't exist or has not been initialized. Off the top of my head, I can't say, "I've run into this exact thing and here is the solution." However, I've definitely run into some...interesting...issues when updating my project dependencies. My first guess is that your webpack.config.js needs to be updated to match the new dependencies. But that isn't much more than a gut feeling or a place to start.
With that, here are some things which may [or may not] be helpful. Anytime I update my dependencies now, I run through these triage points:
Run tns doctor and see if it has any opinions about any existing dependencies
As of NativeScript 6.3.0, there is no longer a need to use the older tns-core-modules/. Instead, use #nativescript/core/. If you are using the older, backward-compatible modules, make sure that their versions have also been updated (both tns-core-modules and tns-platform-declarations).
When I updated my dependencies, I also deleted my webpack.config.js file so that NativeScript would generate a new, current version. tns update does not appear to update the Webpack config. At most, a warning may go by in the hundreds of lines of console output while building. After I deleted my Webpack config, and thus allowing NativeScript to generate a new one, GitHub showed some significant differences between the old/new versions.
Thoroughly clean your project: Empty or delete the node_modules folder and run tns platform clean android and tns platform clean ios.
Hopefully, some part of this helps. Good luck!
Adding var process = require('process'); at the top of the default-encoding.js and _stream_writable.js fixed it for me.

Application entry point file not found. nativescript

I create Angular 2 nativescript project and after adding android platform, i run the project in a connected nexus 6p with android version 7.1.1 and when app deployed to the device i got this error:
An uncaught Exception occurred on "main" thread.
java.lang.RuntimeException: Unable to create application com.tns.NativeScriptApplication: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5406)
at android.app.ActivityThread.-wrap2(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.tns.NativeScriptException: Application entry point file not found. Please specify the file in package.json otherwise make sure the file index.js or bootstrap.js exists.\nIf using typescript make sure your entry point file is transpiled to javascript.
at com.tns.Module.bootstrapApp(Module.java:337)
at com.tns.Runtime.run(Runtime.java:508)
at com.tns.NativeScriptApplication.onCreate(NativeScriptApplication.java:17)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1024)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5403)
... 8 more
Caused by: com.tns.NativeScriptException: Failed to find module: "./", relative to: app//
at com.tns.Module.resolvePathHelper(Module.java:159)
at com.tns.Module.bootstrapApp(Module.java:335)
... 12 more
any idea how can i solve this error?
Update:
i create the project with tns create name --ng and i just run it with tns run android command.
the package.js file:
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.Bazim",
"tns-android": {
"version": "2.4.1"
}
},
"dependencies": {
"#angular/common": "2.2.1",
"#angular/compiler": "2.2.1",
"#angular/core": "2.2.1",
"#angular/forms": "2.2.1",
"#angular/http": "2.2.1",
"#angular/platform-browser": "2.2.1",
"#angular/platform-browser-dynamic": "2.2.1",
"#angular/router": "3.2.1",
"nativescript-angular": "1.2.0",
"nativescript-theme-core": "^0.2.1",
"reflect-metadata": "~0.1.8",
"rxjs": "5.0.0-beta.12",
"tns-core-modules": "2.4.3",
"typescript": "~2.0.10",
},
"devDependencies": {
"babel-traverse": "6.21.0",
"babel-types": "6.21.0",
"babylon": "6.14.1",
"lazy": "1.0.11",
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "~2.0.10",
"zone.js": "~0.6.21"
}
}
The problem was from node version, i updated the node and the problem solved!
The package.json file you posted is the wrong one.
There should be another one inside the app folder.
It should look something likes this :
{
"name": "name",
"main": "app.js", //THIS IT THE ENTRYPOINT
"version": "X.X.X",
"author": {
"name": "Name",
"email": "some#email.com"
},
"description": "some desc!",
"repository": {
"url": "https://github.com/yourrepo"
}
}
Verify that the entry point file exists (it has to be a .js file and not a a typescript file) and you should be good to go.
the entry point is defined in angular.json
"architect": {
"build": {
"builder": "#angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/output",
"index": "src/index.html",
"main": "src/main.ts",
but error like this can happen if we have any compile errors, I had it with tests and sub application, I excluded it in tsconfig and now it works
In my case it was related to my NativeScript CLI version. Updated the version and the issue was solved. Just for reference I was at angular-cli 7.3.6 and NativeScript-cli 5.4.0 (got the issue) updated to NativeScript-cli 5.4.2 to solve the issue. Anyone facing the similar issue, try updating your NativeScript CLI version.

Cordova app no showing anything (log says error in ecmascript.js:279)

I followed angular2-meteor tutorial. I tried to debug the app in the simulator and in a smartphone (meteor run android/android-device --verbose). In both cases, the app loads the meteor splash screen. But, after that, only an empty white screen appears.
The only hint I see is within the meteor sun android/android-device logs which state in both cases the following:
I20160603-12:17:11.092(2)? D/MeteorWebApp( 2249): Downloaded asset manifest for version: 64e637af5e28546f390d6025d2c3e5661c275905
I20160603-12:17:11.157(2)? I/MeteorWebApp( 2249): Serving asset bundle with version: 64e637af5e28546f390d6025d2c3e5661c275905
I20160603-12:17:13.070(2) (android:http://localhost:12264/packages/ecmascript-runtime.js:279) Uncaught TypeError: Cannot redefine property: onreadystatechange
I do not know how to continue, how to obtain more information about the error or where is the point where the app failed.
Please, ask me for anything to show. There are so many things that I prefer to post more info as requested to not flooding the post.
Thank you in advance,
Miguel
Edit:
These are my dependencies:
{
"name": "health",
"private": true,
"scripts": {
"start": "meteor run"
},
"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/router": "^2.0.0-rc.1",
"#angular/router-deprecated": "^2.0.0-rc.1",
"angular2-meteor": "^0.5.5",
"angular2-meteor-accounts-ui": "^0.4.3",
"angular2-meteor-auto-bootstrap": "^0.5.5",
"es6-shim": "^0.35.1",
"meteor-node-stubs": "~0.2.0",
"reflect-metadata": "^0.1.2",
"rxjs": "^5.0.0-beta.6",
"zone.js": "^0.6.12"
}
}

Nativescript xml template not refreshing cache issue

so I ran into the following issue.
Sometimes when changing an XML template and getting an error for one reason or another (running the livesync with genymotion), even removing the file content entirely would not reset the file on compilation.
my package.json:
"nativescript": {
"id": "org.nativescript.myapp",
"tns-android": {
"version": "1.7.1"
}
},
"dependencies": {
"nativescript-telerik-ui": "^1.0.1",
"tns-core-modules": "1.7.1"
},
"devDependencies": {
"nativescript-dev-typescript": "^0.3.0",
"typescript": "^1.8.10"
}
Example:
file.xml
<Page
xmlns="http://schemas.nativescript.org/tns.xsd"
class="my-page">
<WrapLayout horizontalAlignment="center">
<Button text="NEW ACCOUNT" tap="onTapAction" visibility="{{ noAccounts ? 'visible' : 'collapsed' }}" />
</WrapLayout>
</Page>
For some reason, after adding the Button tag, I got an error showing up.
Then I tried to:
rollback
remove all cache rm -Rf ./platforms/android/build/* && rm -Rf ./platforms/android/.gradle/ && tns prepare android && tns build android
delete most folders and do a new tns install
tns platform remove android > tns platform add android
etc...
Nothing works and I always get the same error:
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.nativescript.myapp/com.tns.NativeScriptActivity}: com.tns.NativeScriptException:
Calling js method onCreate failed
Error: Building UI from XML. #file:///app/pages/login/start.xml:54:7
���close tagname
File: "/data/data/org.nativescript.myapp/files/app/tns_modules/ui/builder/builder.js, line: 157, column: 16
StackTrace:
Frame: function:'', file:'/data/data/org.nativescript.myapp/files/app/tns_modules/ui/builder/builder.js', line: 157, column: 17
Frame: function:'', file:'/data/data/org.nativescript.myapp/files/app/tns_modules/xml/xml.js', line: 176, column: 17
Frame: function:'EasySAXParser.parse', file:'/data/data/org.nativescript.myapp/files/app/tns_modules/js-libs/easysax/easysax.js', line: 605, column: 22
Frame: function:'XmlParser.parse', file:'/data/data/org.nativescript.myapp/files/app/tns_modules/xml/xml.js', line: 194, column: 22

Categories

Resources