简体   繁体   English

在jenkins上构建时,BuildConfig软件包不存在

[英]Package BuildConfig does not exist while building on jenkins

I'm using jenkins to build my Android app. 我正在使用jenkins构建我的Android应用。 My app makes use of HockeyApp for crashlogging. 我的应用程序使用HockeyApp进行崩溃日志记录。 I have serveral buildTypes but I want to prevent crashes being logged on the buildType I use for development. 我有serveral buildTypes,但我想防止在用于开发的buildType上记录崩溃。

I solved it this way 我这样解决了

if(!BuildConfig.BUILD_TYPE.equalsIgnoreCase("develop")) {
    CrashManager.register(...);
}

However when building on Jenkins my build fails with this error 但是,在Jenkins上构建时,我的构建因此错误而失败

error: package BuildConfig does not exist

I have been using BuildConfig.DEBUG in my app without any problems so far. 到目前为止,我一直在我的应用程序中使用BuildConfig.DEBUG,没有任何问题。 Any ideas what's causing this? 任何想法是什么原因造成的?

Jenkins has no acces to this file. Jenkins没有对此文件的访问权限。 Ensure that you add the path to it. 确保您添加了路径。

Sounds like the import statement for BuildConfig is missing or incorrect. 听起来BuildConfigimport语句丢失或不正确。

It should be import <manifest package name>.BuildConfig; 它应该是import <manifest package name>.BuildConfig;

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

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