簡體   English   中英

由於配置,我的Android項目在Jenkins上構建失敗

[英]Build fails on Jenkins for my Android project due to config

我正在嘗試為我的android項目設置Jenkins Job。 該項目已在我的本地計算機上成功構建,但在Jenkins上失敗,並出現以下錯誤:

配置項目':app'時發生問題無法評估模塊齊射:找不到名稱為'default'的配置。

.gitmodules

[submodule "volley"]
    path = volley
    url = https://android.googlesource.com/platform/frameworks/volley

應用:build.gradle文件

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
    signingConfigs {
        release {
            storeFile file('my-release-key.keystore')
            storePassword "******"
            keyAlias "release-key"
            keyPassword "*******"
        }
    }

    applicationVariants.all { variant ->
        variant.outputs.each { output ->
            def outputFile = output.outputFile
            if (outputFile != null && outputFile.name.endsWith('.apk')) {
                def fileName = outputFile.name.replace('app-release.apk', "myproject.apk")
                output.outputFile = new File(outputFile.parent, fileName)
            }
        }
    }

    lintOptions {
        abortOnError false
    }

    configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:23.1.0'
    }

    compileSdkVersion 23
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "com.myproject.****"
        minSdkVersion 16
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        signingConfig signingConfigs.release
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        //setProperty("archivesBaseName", "myproject")
    }
    buildTypes {
        release {
            minifyEnabled false
            shrinkResources true
            debuggable false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
    packagingOptions {
        exclude 'LICENSE.txt'
    }
    productFlavors {
    }
    testOptions {
        unitTests.returnDefaultValues = true
    }
    sourceSets { main { java.srcDirs = ['src/main/java'] } }
}


dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile project(':volley')
    androidTestCompile 'com.android.support.test:runner:0.4'
    androidTestCompile 'com.android.support.test:rules:0.4'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.1'
    testCompile 'junit:junit:4.12'
    testCompile 'org.mockito:mockito-core:1.10.19'
    testCompile files('libs/json.jar')
    testCompile 'org.json:json:20140107'
    compile 'com.google.android.gms:play-services-identity:8.3.0'
    compile 'com.google.android.gms:play-services-plus:8.3.0'
    compile 'com.android.support:appcompat-v7:23.1.1'
    compile 'com.android.support:design:23.1.1'
    compile 'com.android.support:cardview-v7:23.1.1'
    compile 'com.android.support:recyclerview-v7:23.1.1'
    compile 'org.apache.commons:commons-lang3:3.4'
    compile 'com.github.clans:fab:1.6.1'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.squareup.okhttp:okhttp:2.6.0'
    compile 'com.google.code.gson:gson:2.2.4'
}
apply plugin: 'idea'

settings.gradle

include ':app' , ':volley'

項目-build.gradle

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.0'
        classpath 'com.google.gms:google-services:1.5.0-beta2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我已經通過克隆回購建立了齊射

https://android.googlesource.com/platform/frameworks/volley

我也嘗試過截擊和重新克隆的方法,但是沒有用

該錯誤消息看起來像是凌空子模塊尚未克隆到工作區中。
您不應該手動克隆它,而讓詹金斯為您完成。

Jenkins默認不克隆子模塊(出於某些未知原因),但是您可以在作業配置中啟用它。 在Git部分中,選擇:
其他行為>添加>高級子模塊行為

您還可以在出現的部分中檢查“遞歸克隆子模塊”選項,但我認為凌空不需要這個。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM