2015-06-23 59 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") 
... 
} 
相关问题