2017-09-16 77 views
1

我想構建我的第一個Ionic Cordova應用程序(天氣應用程序)的發佈版本,並獲取錯誤「無法讀取或創建安裝屬性文件」。如下面的控制檯輸出所示。IONIC CORDOVA - 無法讀取或創建安裝屬性文件

顯然這是一個權限問題,但我沒有選中C:\ Program Files(x86)\ Android文件夾(和子目錄)的只讀,但仍然存在相同的問題。還有什麼我失蹤?幾個小時以來一直困在這。

我正在Visual Studio中開發我的應用程序,未安裝Android Studio。


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. 

回答

0

Android SDK中居住在Program Files文件夾,因此寫入文件的問題。將Android sdk移至C:\並更新環境ANDROID_HOME變量並解決問題。

相關問題