Search code examples
androidandroid-studio-3.6

BuildConfig is not working in Android studio 3.6.1


I was trying to get current version name of my android studio project. after updating my Studio to 3.6.1 i am facing difficulty in importing BuildConfig


Solution

  • I've noticed this as well.

    It was after a 'Clean Project' that AS forgot the import com.my_project.BuildConfig; statement.

    Restoring the import statement manually wherever it was complaining about BuildConfig and then doing a 'Rebuild Project' seemed to work, at least until the next time.

    Tip: don't accept the offered suggestion to import the class from ...compat.v4... you want the app level definition.

    Update April 4th: The newly released AS 3.6.2 doesn't seem to suffer from this problem.