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
If you read the docs it shows you how to do this. https://ionicframework.com/docs/deployment/play-store
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
In android Studio go to build and click (APK)
Hope this will work