Compiling APK

Back to course
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #6497

    Karol
    Participant

    Hello,

    While preparing “production” version, I get this error, please help.

    Thank you in advance.

    C:\Users\KRZYSZTOF\3kurs>ionic cordova build –release android
    > cordova platform add android –save
    Using cordova-fetch for [email protected]~7.0.0

    (node:2040) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): CordovaError: Failed to fetch platform [email protected]~7.0.0
    Probably this is either a connection problem, or platform spec is incorrect.
    Check your connection and platform name/version/URL.
    Error: cmd: Command failed with exit code ENOENT
    (node:2040) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

    #6544

    Alex
    Keymaster

    Well this issue is appearing due to two reasons :

    1. permissions to access files from project were not given while running that command

    2. or android platform is not installed .

    follow these steps :

    1. First of all if you are on windows Os run your command prompt as an administrator : http://www.thewindowsclub.com/how-to-run-command-prompt-as-an-administrator

    https://www.howtogeek.com/194041/how-to-open-the-command-prompt-as-administrator-in-windows-8.1/

    if you are on mac then try adding ‘ sudo ‘ in the beginning of each command .

    2. Navigate to your ionic project folder .

    Then run following commands :

    ionic cordova platform rm android

    ionic cordova platform add android

    Then generate the resources  :

    ionic cordova resources

    then generate apk .

     

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.