2

我有一个包含更多模块的 Android 项目。当我尝试在 Android Studio 2.1 中构建这个项目时,它工作正常,但是当我尝试使用 Jenkins 构建时,我得到了这个错误:

* Where: Build file 'D:\Jenkins\workspace\MyProject\mylibrary\build.gradle' line: 1

* What went wrong: A problem occurred evaluating project ':mylibrary'.
> Failed to apply plugin [id 'com.android.library']
   > Could not create an instance of type com.android.build.gradle.internal.dsl.SigningConfig_Decorated.

该模块的 build.gradle 文件(mylibrary):

apply plugin: 'com.android.library'

android {
    compileSdkVersion 21
    buildToolsVersion '21.1.2'

    defaultConfig {
        minSdkVersion 11
        targetSdkVersion 21
        versionName "1.0"
        versionCode 3
    }
       .
       .
       .            
}

摇篮插件:

classpath 'com.android.tools.build:gradle:2.1.0'

有什么问题可以解决?感谢您的评论。

4

1 回答 1

0

问题是詹金斯试图在 C:\users\administrator.android\ 下创建文件,但詹金斯没有这样做的权限。

解决方案:将所有 android 部件移动到一个(非默认)文件夹(例如 D:\android\ 基于此指令http://www.littlecpu.com/android-studio-c-drive

于 2016-05-20T07:22:45.673 回答