简体   繁体   English

Jenkins构建中的Android项目

[英]Android project in Jenkins build

I have an Android project with more modules. 我有一个带有更多模块的Android项目。 When I tried to build this project in Android Studio 2.1 this, is working fine, but I when I tried to build with Jenkins I get this error: 当我尝试在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 file of this module (mylibrary): 该模块的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
    }
       .
       .
       .            
}

Gradle plugin: Gradle插件:

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

What can by a problem? 有什么问题可以解决? Thanks for comments. 感谢您的评论。

Problem was that Jenkins tried to create files under C:\\users\\administrator.android\\ , but jenkins has no permission to do this. 问题是Jenkins尝试在C:\\ users \\ administrator.android \\下创建文件,但是jenkins无权执行此操作。

Solution: moved all android parts to one (non default) folder (eg D:\\android\\ based on this instruction http://www.littlecpu.com/android-studio-c-drive ) 解决方案:将所有android部件移动到一个(非默认)文件夹中(例如,根据以下说明http://www.littlecpu.com/android-studio-c-drive,将 D:\\ android \\)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM