Issue
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";
}
Solution
I rebuilt the project with react-native upgrade
.
My issue was then that I had old files that were referencing the old package names (because I changed the name of the app in package.json
). Once deleting those, I resolved the issue.
Answered By - Overload119
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.