简体   繁体   中英

error: package android.view does not exist on enabling view binding android

Current Android Studio Version: 4.1.3

buildFeatures {
        viewBinding true
    }

After enabling view binding in build.gradle I am getting the following error:

error: package android.view does not exist
import android.view.LayoutInflater;

in generated class FragmentFeedBinding

Ideally you don't need to change anything in generated files at all. try to clean and rebuild and see if that fixes your problem. Many times its android studio

I can work around this by forcing Android Studio to use java8 through JAVA_HOME.

Not great.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM