Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IONIC CORDOVA - Failed to read or create install properties file

I am trying to build a release version of my first Ionic Cordova app (Weather app), and getting the error "Failed to read or create install properties file." as shown in the console output below.

Obviously this a permissions issue, but I have unchecked the read-only for the C:\Program Files (x86)\Android folder (and child directories) but still have the same issue. Is there something else I am missing? Have been stuck on this for hours.

I am developing my application in Visual Studio, Android Studio is not installed.


C:\Dev\Zealand>ionic cordova build android --release
[INFO] Running app-scripts build: --platform android --target cordova

[14:58:54]  build dev started ... [14:58:54]  clean started ...
[14:58:54]  clean finished in 11 ms [14:58:54]  copy started ...
[14:58:54]  transpile started ... [14:59:00]  transpile finished in
6.34 s [14:59:00]  preprocess started ... [14:59:00]  deeplinks started ... [14:59:00]  deeplinks finished in 47 ms [14:59:00] 
preprocess finished in 57 ms [14:59:00]  webpack started ...
[14:59:00]  copy finished in 6.86 s [14:59:15]  webpack finished in
15.31 s [14:59:15]  sass started ... [14:59:18]  sass finished in 2.44 s [14:59:18]  postprocess started ... [14:59:18]  removed unused font files [14:59:18]  postprocess finished in 42 ms
[14:59:18]  lint started ... [14:59:18]  build dev finished in 24.29
s
> ionic cordova prepare android
> cordova prepare android [14:59:21]  lint finished in 2.75 s

> cordova build android × Running command - failed!
        [ERROR] An error occurred while running cordova build android (exit code 1):

    ANDROID_HOME=C:\Program Files (x86)\Android\android-sdk
    JAVA_HOME=C:\Program Files\java\jdk1.8.0_131
    Subproject Path: CordovaLib
    The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please
    use Task.doLast(Action) instead.
            at build_5uypyiboi6cuvi75t8w2rqt55.run(C:\Dev\Zealand\platforms\android\build.gradle:137)
    Checking the license for package Android SDK Platform 25 in C:\Program Files
    (x86)\Android\android-sdk\licenses
    License for package Android SDK Platform 25 accepted.
    Preparing "Install Android SDK Platform 25".
    Warning: Failed to read or create install properties file.

    BUILD FAILED

    Total time: 6.774 secs

    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring root project 'android'.
    > Failed to install the following SDK components:
       [Android SDK Platform 25]
       The SDK directory (C:\Program Files (x86)\Android\android-sdk) is not writeable,
       please update the directory permissions.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log
    output.
    Error: cmd: Command failed with exit code 1 Error output:
    FAILURE: Build failed with an exception.

    * What went wrong:
    A problem occurred configuring root project 'android'.
    > Failed to install the following SDK components:
       [Android SDK Platform 25]
       The SDK directory (C:\Program Files (x86)\Android\android-sdk) is not writeable,
       please update the directory permissions.

    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log
    output.
like image 389
Kyle Avatar asked Oct 20 '25 12:10

Kyle


1 Answers

Android sdk resided at Program Files folder, therefore an issue writing the file. Moved Android sdk to C:\ and update Environment ANDROID_HOME variable and issue was resolved.

like image 130
Kyle Avatar answered Oct 23 '25 08:10

Kyle