I'm getting this error when trying to compile my React Native android app. The Android app can't resolve BuildConfig.DEBUG.
:app:processDebugJavaRes UP-TO-DATE :app:compileDebugJavaWithJavac /Users/amirsharif/mobile-rappad/android/app/src/main/java/com/rappadmobile/MainActivity.java:29: error: cannot find symbol .setUseDeveloperSupport(BuildConfig.DEBUG) ^ symbol: variable BuildConfig location: class MainActivity >1 error :app:compileDebugJavaWithJavac FAILED
I can temporarily resolve it by simply setting it to true. This might've happened after I changed an application name (since that's something I've also been trying to do).
I probably have to change something with Gradle so it generates the right kind of files again.
/** * Automatically generated file. DO NOT MODIFY */ package com.app; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "com.rappadmobile"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 1; public static final String VERSION_NAME = "1.0"; }
I had the same issue and it was resolved by simply adding following import statement in MainApplication.java
:
import com.facebook.react.BuildConfig;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With