(FRONT) FRONT (2023)

NativeScript and Android troubleshooting.

During development Android application I'm faced with a millions various troubles, this is only a small list of them, only if I have time to descripted them.

1. NS Demo example can not started.

I simple create new NS project and try to start it.


# ns create myProject --ng
# ns clean
# npm i

But project failed despite I have last version of all related software.



Solution is non-obvious - need to change Angular ngZone from 13 to 12 - https://angular.io/api/core/NgZone.


2. Platform tools don't working

In my Windows developer environment there are nothing any trouble with Platform-tools.



But in my Linux environment I have simple trouble. Its look strange, because all my old project working fine, and Android Studio don't require any updates, therefore I don't understand instantly what happens. But in reality this is complex trouble, because Android studio change directory with platform tools and JAVA is outdated.

So, I have update Android tools, but it still don't working.



Need to update JAVA.



Important point of OpenSuse is 3 place where we can set up JAVA_HOME variable.



This is main place.



And two this updates is solution to make Android tools workable.



4. NS build errors: "build failed with exception"



Usually unresolved, you can try to upgrade NS



5. NS Runtime errors: com.tns.NativeScriptException: Failed to find module: "@nativescript/xxxxxxxxx", relative to: app/tns_modules.



Unresolved, but in some case you can import only parts of module:



6. Analyze device log with Adb.

Adb log is cool way to search troubles (if application can not started)



7. Difference between debug and release version.

Debug version usually never crashed if NS version is workable and can build at all, because needed version adding by webpack on demand. In release version you need to add needed packages manually.



See more details about this trouble in topics Prepare Nativescript bundle to publishing Google Play console (debug/release troubles).

8. Connect socket inspector.

Connection to socket inspector is cool way to debug application in Runtime (if application can started):


# devtools://devtools/bundled/inspector.html?ws=localhost:40000


9. Use Android studio as Android device File Inspector, as process killer in order to restart Android VM, and use Wipe as restart device emulator.



Related page:












Comments ( )
Link to this page: http://www.vb-net.com/AndroidTroubles/Index.htm
< THANKS ME>