Nativescript 8 Screen freeze after splash screen is loaded in release build - android

Guys I'm working on one of my own projects, and I'm using
nativescript 8.2.1 along with angular 13.2.0
I had some weird issue that is when we run the project using the following command
"ns run android"
application getting compiled and running on emulator fine.
but if I build to production and run it on an emulator I can only see a blank screen or white screen, here is the command used for that
"ns run android --clean --release --key-store-path "PATH/my-release-key.keystore" --key-store-password myPass --key-store-alias myAlias --key-store-alias-password myPass"
this is screenshot
This is what my root route looks like, redirection to home route is not working. but I tested if I add a button to app.component.html then I can see that button on the emulator screen. but routing is not working
This issue is caused when we only build with --release command otherwise debug mode it's working fine.
need your help on this

After spending multiple days of debugging, I finally, figure out the reason why the production build screen is getting frozen.
This is happening due to Firebase
I configure the firebase to my app referring through Nativescript version 8 documentation, here is the configuration that I have did
https://docs.nativescript.org/plugins/firebase-firestore.html
npm install #nativescript/firebase-firestore
//importing firebase modules
import { firebase } from "#nativescript/firebase-core";
import "#nativescript/firebase-firestore";
//Initialize firebase as per nativescript documentation
await firebase().initializeApp();
in debug mode, this is working fine without any issue, but the production release builds it's not working.
For resolve this issue. I used a different firebase package.
here is the documentation link https://github.com/EddyVerbruggen/nativescript-plugin-firebase
if you are NativeScript 7+:
tns plugin add #nativescript/firebase
for NativeScript 6:
tns plugin add nativescript-plugin-firebase
Thanks..

Related

React Native version mismatch - only when compiled in Android Studio - works in METRO

I recently updated my react native app to version 0.61.5. The old version was 0.59.3
Everything was working fine while I was doing the upgrades. Then, I tried to make a signed APK and submit for beta testing to Android Store. That APK did not work on any of my android devices. It just gave a blank white screen on open - javascript failed.
Later, I was able to replicate the error, and get actual and virtual devices to show this red screen (see image), even for testing, whenever the app is built exclusively in Android Studio.
Error reads:
console.error: "React Native version mismatch.
JavaScript version: 0.59.3
Native version: 0.61.5
etc...
When I "npm run start" in the terminal, outside Android Studio, it starts up the Metro bundler. Then everything works fine, both real and virtual devices. Somehow the Metro bundler is able to reconcile something but Android Studio's bundler is not.
Since Android Studio's APK generator uses it's native javascript bundler, I need to figure out why this is happening, and fix it.
I have tried
- clearing caches, deleting the project, invalidating caches, watchmen etc.
- adding implementation ("com.facebook.react:react-native:0.61.5") {force = true} (in build.gradle)
- many other solutions given for this error message found on stack overflow...
2 days on this. No idea.
screenshot

Ionic 2 Android release app not working

I am facing a really weird problem with my APK release.
First ionic Deploy it's always undefined, it seems that is not injected.
Second, if I open and close the app several times I get a messages saying that cordova it's not loaded.
The most weird thing is that happens only with the android release, but it works perfectly with android debug.
Any help? Please? Thanks.
check your main actvity and xml are of same name and make sure that it has been declared in your manifest properly.
now 1. clean your project once
re-build your project
now generate your apk.
Guys I found the issue.
If I run this command he apk works perfectly
ionic build android --release
but if I run
ionic build android --release --prod
the size of the apk it's different and gave me that problem.
The problem for me seemed to be with the "pageName.component.ts" file that is created when you use the "ionic generate page" command.
Create your pages manually and run it (ionic run android --prod) or (ionic run android --prod) again.
it worked for me.
Home they fix it soon.

How to diagnose white screen on startup on Android device

I've been developing my Ionic 2 app, running in the browser, and also running fine on the device with the debug build. ionic -v gives me 2.2.1, and in package.json have...
"ionic-angular": "2.0.1",
"ionic-native": "2.4.1",
I wanted to start to test out a release build. I have create the keystore file etc and did some release builds.
Initially, I used ionic build android --release and installed this, and everything worked fine. After I discovered this does not minimize, and to do so I then built using ionic build android --prod --release. Looking in the .apk it is minimized as expected. I install it and the installs works fine.
However, when I run it, I just get the splash, and then a white screen, and that is it. I simplified my app.component.ts to remove all my startup logic, so I just hardwire to a new new near blank page, and now have nothing but the following in the MyApp constructor...
this.platform.ready().then (() => {
StatusBar.styleDefault();
Splashscreen.hide();
});
Still nothing. I created a blank app, and tried the same build (ie ionic build android --prod --release), and that worked fine.
So, there must be something in mine. But this only occurs in the minified release, so I can't debug into it (or didn't seem to be able to). I am not sure how to track down what the error could be. Are there any startup logs etc?
Does anyone have any suggestions?
Thanks in advance!

ionic android build succeeded but app stopped working

When I am trying to run app on android device using ionic run android, it is showing the build and launch as successful.
On device, it is showing
app_name stopped working
I searched a lot and tried installing plugins again, not working. I'm not using ionic-keyboard plugin. Any help would be appreciated.
UPDATE: When I'm using ionic serve --lab, it is showing perfectly on browser with some of the plugins not working because browser doesn't support all the cordova plugins. That's fine.
ionic platform add android shows at the end
saving platform to package.json file
believe something to do with ionic-keyboard. can you try installing keyboard plugin once and checking the app if it works or not. Thus we will have some RCA.
Can't run Ionic on Android: class not found exception IonicKeyboard

Ionic Build or Ionic Run builds the wrong app

I am trying to build or run an Ionic Cordova App. But it always builds a default app with playlists.
OS is Windows 10
I do the following from my command prompt:
c:\users\martijn\documents\ionic start testapp blank
c:\users\martijn\documents\testapp\ionic run android
now it is building a different app then in my app directory. When I do ionic serve I see the right app in my browser. Can't figure out why running or building gives me a different app, I think it is a default example app.
Can somebody help?
See link here:
https://github.com/driftyco/ionic-cli/issues/1283
Appears you may have to delete the the last apk file from platforms\android\build\outputs\apk

Categories

Resources