我试图导入我从github获得的Open Data Kit Sc,但是我一直收到错误 [英] I'm trying to import Open Data Kit Sc that i got from github, but i kept getting error

查看:159
本文介绍了我试图导入我从github获得的Open Data Kit Sc,但是我一直收到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从github导入了一个代码,但是我收到了这个错误。

错误:(12,0)CreateProcess error = 2,系统找不到指定的文件

这是github的链接



https://github.com/opendatakit/collect



这是我的gradle.build文件

  / ************************** ************************************************** ********************** 
GRADLE CONFIG
****************** ************************************************** ***************************** /

if((new File(gradle.local))。 exists()){
apply from:gradle.local
} else {
apply from:gradle.remote
}

applicationScripts.each {
适用于:it
}

应用插件:'com.android.application'

com.android.ddmlib.DdmPreferences.setTimeOut(60000)

android {
//以下内容在common.gradle文件中设置
compileSdkVersion(compileVersion)
buildToolsVersion(buildTools)

defaultConfig {
applicationId(org.odk.collect 。)
minSdkVersion(9)
targetSdkVersion(9)
versionCode(1061)
versionName(1.4.10)
}

productFlavors {
demo {
}

主人{
}

快照{
}

uitest {
}
}

signingConfigs {
release {
if(shouldSign){
storeFile file(signStoreFilePath)
storePassword signStorePass
keyAlias signKeyAlias
keyPassword signKeyPass
}
}
}

buildTypes {
release {
minifyEnabled(缩小)
如果(shouldSign){
signingConfig signingConfigs.release
}
}
debug {
debuggable(true)
testCoverageEnabled(testCoverage)//允许AndroidTest创建JaCoCo报告


$ b packagingOptions {//选择第一次出现任何导致冲突的文件,如common.gradle中定义的
packageList.each {
pickFirst it
}
}

compileOptions {
sourceCompatibility javaVersion
targetCompatibility javaVersion
}
}

configurations.all {
resolutionStrategy {
cacheDynamicVersionsFor(0 ,'seconds')
cacheChangingModulesFor(0,'seconds')
}
transitive = true
}

allproje cts {
tasks.withType(JavaCompile){
options.compilerArgs<< -Xlint:deprecation
}
}
依赖关系{
编译fileTree(dir:'libs',include:'* .jar')
compile'c​​om .google.android.gms:play-services:4.1.32'

//仅测试相关性
testCompile'junit:junit:4.12'
}


解决方案

在开始工作之前,我遇到了同样的问题。
我在Android Studio 2.1中为我工作的一些东西:


  1. 使用Android SDK安装Google Play服务经理


  2. 从这里安装git: https:// git-scm.com/


  3. 在Android Studio中,转到设置 - >插件。
    取消激活&删除github,只保留git插件。


  4. 然后确保您的Android Studio可以联系git

    还有其他一些Android Studio需要下载旧版本的东西。下载&安装这些。


  5. 确保gradle-config位于wiki中提及的正确标签编号处。 $ b


I have imported a code from github but I am getting this error

Error:(12, 0) CreateProcess error=2, The system cannot find the file specified

and this is the link of the github

https://github.com/opendatakit/collect

and this is my gradle.build file

/**************************************************************************************************
 GRADLE CONFIG
 *************************************************************************************************/

if ((new File(gradle.local)).exists()) {
    apply from: gradle.local
} else {
    apply from: gradle.remote
}

applicationScripts.each {
    apply from: it
}

apply plugin: 'com.android.application'

com.android.ddmlib.DdmPreferences.setTimeOut(60000)

android {
    // The following are set in the common.gradle file
    compileSdkVersion(compileVersion)
    buildToolsVersion(buildTools)

    defaultConfig {
        applicationId("org.odk.collect.android")
        minSdkVersion(9)
        targetSdkVersion(9)
        versionCode(1061)
        versionName("1.4.10")
    }

    productFlavors {
        demo {
        }

        master {
        }

        snapshot {
        }

        uitest {
        }
    }

    signingConfigs {
        release {
            if (shouldSign) {
                storeFile file(signStoreFilePath)
                storePassword signStorePass
                keyAlias signKeyAlias
                keyPassword signKeyPass
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled(minify)
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'

            if (shouldSign) {
                signingConfig signingConfigs.release
            }
        }
        debug {
            debuggable(true)
            testCoverageEnabled(testCoverage) // Allows AndroidTest JaCoCo reports to be generated
        }
    }

    packagingOptions { // Pick first occurrence of any files that cause conflicts, as defined in common.gradle
        packageList.each {
            pickFirst it
        }
    }

    compileOptions {
        sourceCompatibility javaVersion
        targetCompatibility javaVersion
    }
}

configurations.all {
    resolutionStrategy {
        cacheDynamicVersionsFor(0, 'seconds')
        cacheChangingModulesFor(0, 'seconds')
    }
    transitive = true
}

allprojects {
    tasks.withType(JavaCompile) {
        options.compilerArgs << "-Xlint:deprecation"
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    compile 'com.google.android.gms:play-services:4.1.32'

    // Testing-only dependencies
    testCompile 'junit:junit:4.12'
}

解决方案

I had the same issue before I got it to work. Some things that I did that worked for me in Android Studio 2.1:

  1. Install Google Play services using Android SDK manager

  2. Installed git from here: https://git-scm.com/

  3. In Android Studio, Goto Settings -> Plugins. Deactivate & remove github, keep only git plugin.

  4. Then make sure your Android Studio can contact git

  5. There were other stuff for which Android studio says it requires to download older versions. Download & install these as well.

  6. Make sure gradle-config is at the right tag number as mentioned in the wiki.

这篇关于我试图导入我从github获得的Open Data Kit Sc,但是我一直收到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆