I am trying to convert our Android application to a gradle build. I have the project and it\'s libraries building successfully. I am now trying to create separate apks fo
first do
File -> Invalidate Caches/Restart... -> Invalidate and Restart
then do
Build -> Clean Project
then do
Build - > Rebuild Project
If you are modifying your Environment Variables, and they are not reflecting correctly in Android studio try doing:
Build -> Clean Project
File -> Invalidate Caches/Restart... -> Invalidate and Restart
Try to do
Build -> Clean Project
then do
Build - > Rebuild Project
If it doesn't work, try
File -> Invalidate Caches/Restart... -> Invalidate and Restart
then do
Build -> Clean Project
then do
Build - > Rebuild Project
I had same issue and fixed it like below:
buildConfigField 'String', 'BASE_URL', '"https://api.example.com"'
Just in case that helps somebody else, in my case it was a missing import:
import uk.co.yourpackage.yourapp.BuildConfig;
Somehow, nowhere in the doc does it mention you need that include! Made me think it was automatically imported somehow but it ISN'T. not for me at least... So much time lost... Hope that helps another newbie like me!
In the project.ext.envConfigFiles array, ensure you set the debug to the right .env file you are using for development