2015-06-23 62 views
-3

我從here進口卡掃描項目,但是當我導入項目提示錯誤沒有2導入項目:無法從GtiHub,沒有這樣的文件或目錄

沒有這樣的文件或dirctory

在這一行中的build.gradle:

"git describe --match=*[0-9]*.[0-9]*.*[0-9] --tags --dirty --always".execute().text.trim() 

我沒有得到確切的意思,如果這除了線說不這樣的文件或目錄,並且也是,我不知道是什麼!

+0

問題不夠清楚。請多解釋一下。 – AndroidLad

+0

您能否詳細說明一下:您檢出項目並運行「gradle」。您是否按照自述文件(克隆,子模塊,屬性)中的步驟操作?你指定的命令似乎在[此gradle文件](https://github.com/card-io/card.io-Android-source/blob/master/card.io/build.gradle) – Kariem

+0

我只是無法導入項目的項目。它仍然在說「沒有這樣的文件或目錄」 –

回答

0

使用過Android Studio(搖籃):看看這個博客帖子:http://blog.android-develop.com/2014/09/automatic-versioning-and-increment.html

下面是從實現博客:

android { 
defaultConfig { 
... 
    // Fetch the version according to git latest tag and "how far are we from last tag" 
    def longVersionName = "git -C ${rootDir} describe --tags --long".execute().text.trim() 
    def (fullVersionTag, versionBuild, gitSha) = longVersionName.tokenize('-') 
    def(versionMajor, versionMinor, versionPatch) = fullVersionTag.tokenize('.') 

    // Set the version name 
    versionName "$versionMajor.$versionMinor.$versionPatch($versionBuild)" 

    // Turn the version name into a version code 
    versionCode versionMajor.toInteger() * 100000 + 
      versionMinor.toInteger() * 10000 + 
      versionPatch.toInteger() * 1000 + 
      versionBuild.toInteger() 

    // Friendly print the version output to the Gradle console 
    printf("\n--------" + "VERSION DATA--------" + "\n" + "- CODE: " + versionCode + "\n" + 
      "- NAME: " + versionName + "\n----------------------------\n") 
... 
} 
相關問題