3

I'm using jenkins to build my Android app. My app makes use of HockeyApp for crashlogging. I have serveral buildTypes but I want to prevent crashes being logged on the buildType I use for development.

I solved it this way

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

However when building on Jenkins my build fails with this error

error: package BuildConfig does not exist

I have been using BuildConfig.DEBUG in my app without any problems so far. Any ideas what's causing this?

MrJM
  • 1,214
  • 1
  • 12
  • 26

3 Answers3

2

Sounds like the import statement for BuildConfig is missing or incorrect.

It should be import <manifest package name>.BuildConfig;

Christopher Orr
  • 110,418
  • 27
  • 198
  • 193
2

Jenkins has no acces to this file. Ensure that you add the path to it.

1

On the top of your MainActivity.java file import import com.facebook.react.BuildConfig; or import com.<YourProjectPackageName>.BuildConfig; and then inside your environment values put these two:

IS_NEW_ARCHITECTURE_ENABLED=false
IS_HERMES_ENABLED=true

My current project is react-native, we are using a .env file, and I have put those two variables inside the .env file.

AmerllicA
  • 29,059
  • 15
  • 130
  • 154