0

I am trying to convert my existing Angular 8 app to an android app using Cordova.I am following this tutorial.

But, I am getting a white screen when I install the signed and release build in a Android device.Any suggestion?

4
  • What about a debug version? Can you install and run it successfully in debug mode? Commented Nov 15, 2019 at 12:00
  • post logs...... Commented Nov 15, 2019 at 12:04
  • @KaloyanDimitrov I can install the app ,even cordova run browser works fine (i can see the app being rendered) .In emulator as well it shows a white screen Commented Nov 15, 2019 at 12:57
  • @Abx are you listening to the deviceready event to bootstrap your app? If cordova is not improrted properly you might not have the event firing and the app wont start at all which would look like a white screen. How does your index.html look like and also the part where Angular is getting bootstraped? If you are still having this problem you need to provide some more information. Good luck. Commented Nov 18, 2019 at 9:22

1 Answer 1

1

The following steps work for me

  1. Install cordova globally

  2. Go into the Angular project folder and run this cordova create mobile

  3. If there is not a folder inside your Angular project folder called "dist", run this: ng build

  4. Change directory cd mobile

  5. Link the dist file with the www file. Run this command in cmd as administrator mklink /d "C:\Users\....\www" "C:\Users\....\dist"

  6. Go to the parent directory (you should be in the Angular project folder now) and run this: ng build

  7. Go to mobile\www\index.html and do this change <base href="/"> --> <base href="./">

  8. Go to the mobile directory (cd mobile) and run this cordova platform add android

  9. Connect the android phone and run this cordova run android

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.