How to solve error: constant expression required
After I upgrade Gradle version upto 8.0, I encounter "constant expression required" error.
This is because AGP 8.0 doesn't allow reference to resourceID.
In my case, I use below code:
switch(view.id) {
case sample1:
case sample2:
......
}
Solution1:
Change switch statement to if-else statement
Solution2:
Add below properties to gradle.properties file
android.nonFinalResIds = false
댓글 없음:
댓글 쓰기