How do i handle errors in nativescript app? - javascript

i am done coding my App and i will be publishing soon. Right now, when there is an error in the app, it stops the whole app and shows StackTrace errors. please how can i stop this.
i saw a solution relating to this on the nativescript website
this is what i have tried below
import * as traceModule from "tns-core-modules/trace";
const errorHandler = {
handlerError(err) {
}
};
traceModule.setErrorHandler(errorHandler);
NB: i use nativescript core (javascript)

saw this solution on stackoverflow
When an android application is built in release mode;
tns build android --release --key-store-path [path] --key-store-password [pw] --key-store-alias [alias] --key-store-alias-pw [pw]
The app will automatically disable the stack trace screen on Android. By default the tns build android will be building debug mode applications.

Related

Unable to solve Android target error in Meteor add-platform android

I using a Macbook Pro M1 and decided to do start developing mobile app using Meteorjs framework, since I've used the framework for web development. I've followed a tutorial online on how to get that going but currently facing a problem:
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: Command failed with exit code 1: avdmanager list target
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.AvdManagerCli.run(AvdManagerCli.java:213)
at com.android.sdklib.tool.AvdManagerCli.main(AvdManagerCli.java:200)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 5 more
✓ Gradle
It seems that there's only one requirement that failed, and I've searched for the solution but couldn't find anything that resembles a similar problem that I'm facing. Hoping for you to help point me to the right direction.
I have installed the Android Studio, uninstalled and reinstalled the Android SDK Build-Tools 32, Android SDK Command-line Tools, Android SDK Platform-Tools, and Android Emulator.
Currently, my ~/.bashrc file setup is like this:
export ANDROID_HOME=$HOME/Android/Sdk
export ANDROID_SDK_ROOT=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
...and my ~/.bash_profile:
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib
and I've got Gradle working just fine. Tested building a generic Android app using one of the samples in Android Studio. The build was successful.
But I can't get the meteor add-platform android to pass the checks. Anyone?
This problem was solved by installing JDK8.
Source for Macbook Pro M1: https://www.azul.com/downloads/?version=java-8-lts&os=macos&architecture=arm-64-bit&package=jdk

Can i make console logs visible in a cordova app running on an emulator?

Hello i'am currently building an app with cordova and the quasar framework.
I'm experiencing some problems in my android version running on an emulator that dont happen in my web version.
Is there a way to make the errors visible in some way or another.
Im using android studio as my emulator.
Open a chrome window on the same machine the emulator is running on. Navigation to chrome://inspect/#devices, you should be able to debug the emulator from there, giving you the full devtools, providing the APK is a dev build. This will not work for production builds.

nativescript 4.2. Error while building android app with release flag

I've done some app for IOS and Android.
IOS is working fine and it's poblished on App store since 3 weeks.
So, the time has come for android. I have to do some css tweaks, beacuse android was looking different in some aspects.
After when i did it, i run tns run android, next emulator appear.
All is working well, so i've run tests on Firebase console.
It was a suprise for me, beacuse i saw this error: (Emulator installed is launching app without issues.)
Nativescript fails to load code that holds common js functions.
Here is part of my app.js
And, right now i'm able to see this error in my emulator.
Steps to reproduce:
- run tns run android (app is working well)
- do some typo in any js file (make any error): livesync will run again, and as result i will see this error.
My question is: do android have problems with requiring this file? IOS is working very well, but i'm unable to deploy android.
Thank you.

Can't upload React Native app to iTunes Connect with Xcode 7.3

I made an app using React-Native for iOS and I can't publish it to the App Store. When I go to the Xcode Organizer and follow the steps to upload the Archive, it throws the following error when Sending API usage to iTunes Connect.
Yesterday, I tried validating and uploading other apps made with Swift and it worked.
Solution found setting the minimum required version of iOS to 8.1.
It supposed to be a launch-screen-related error.
NOTE: This solution also applies for Xcode 8.

ionic-material demo on android bowser/hybrid-App templates not showing

I successfully build the ionic-material demo
Ionic-material Demo
when I do ionic server
the browser opens and the app works as excpected but
when compiled on android
ionic platform add android
ionic build android
ionic run android
the app compiled and run but I'm not able to show diffrent screens on navigate the url changes and the floting action buttons show up but not te template files ?
what I'm doing wrong or what might be the problem ??
I added alert("debug") in the controller and the alert is showing up on navigation so just the template not rendering
note ionic is built over AngulaJs so Angular experts can help too
any help appreciated
Steps i'd take to debug this are:
run ionic serve, and check the console for angularJS errors and resolve any if there are any
run - ionic platform add android + ionic run android with a connected android device and from another console window run the following command to run logcat via ADB
adb logcat CordovaActivity:V CordovaWebView:V CordovaWebViewClient:V IceCreamCordovaWebViewClient:V CordovaLog:V *:S
Resolve any errors the ADB flags
Try ionic platform add android + ionic run android again
Note: ionic handles touch events in browser and on device so this will not be the issue, it is likely it is a syntax error that has stopped the compile to device

Categories