Nativescript xml template does not update cache issue

so I ran into the following problem.

Sometimes when changing the XML template and getting an error for one reason or another (using the liveync function with genymotion), even deleting the contents of the file will not completely reset the file during 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. Then I tried:

  • Rollback
  • delete the entire cache rm -Rf ./platforms/android/build/* && rm -Rf ./platforms/android/.gradle/ && tns prepare android && tns build android
  • delete most folders and create 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 
+5
source share

Source: https://habr.com/ru/post/1247680/


All Articles