skip to Main Content

I am working on an Ionic Angular project and I need to build an APK file to distribute my app to Android devices. I have tried researching and following various tutorials, but I’m still facing some difficulties. Could someone please guide me through the process of building an APK for my Ionic Angular project?

ionic capacitor add android

ionic : File C:UsersteamAppDataRoamingnpmionic.ps1 cannot be loaded because running scripts is disabled on this system. For
more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1

  • ionic capacitor add android
  •   + CategoryInfo          : SecurityError: (:) [], PSSecurityException
      + FullyQualifiedErrorId : UnauthorizedAccess
    

2

Answers


  1. If you read the docs it shows you how to do this. https://ionicframework.com/docs/deployment/play-store

    Login or Signup to reply.
  2. First of all you have to set _Execution_Policies

    Just Open powershell in administrative mode and run the following command

    "Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted"

    Then

    1. add android (npx cap add android)
    2. build .www folder (ionic build)
    3. sync you project (npx cap sync android)
    4. open android studio ( npx cap open android )

    In android Studio go to build and click (APK)

    Hope this will work

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search