Never too old to learn, and I did it. I learned Java, I learned Kotlin, I learned Kotlin, and I filled in the holes

A, cause

As the Kotlin-Android-extensions are deprecated, any code previously written in Kotlin is subject to modification. I’ll just try findByViewId, it’s fine. The amount of code has increased a lot and has affected the workload rate. Still not acceptable.

When added to all Android {

buildFeatures {
        viewBinding true
    }
Copy the code

And then synchronize. Be sure to synchronize.

2. No access to ViewBuilding

When writing binding code

binding = ActivityAccountDisableBinding.inflate(layoutInflater)
setContentView(binding.root)
Copy the code

An error was reported

Cannot access ‘android.viewbinding.ViewBinding’ which is a supertype of ‘com.qeebike.account.databinding.ActivityAccountDisableBinding’. Check your module classpath for missing or conflicting dependencies

No access, inThe viewBinding has already been loaded, but there are no permissions. Asked a lot of Baidu, dog dad, Brother Bing. But still no, no answer.

A blind cat meets a dead mouse

Compared with other projects, everything is normally configured, but there is no problem with other projects. After the last brainless attempt to copy the configuration. Add the contents of gradle.properties

## Project-wide Gradle settings.
#
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
 org.gradle.parallel=true
#Mon Jan 16 14:18:22 CST 2017
org.gradle.jvmargs=-Xmx1536m
android.injected.testOnly=false
Copy the code

Modified to

# Project-wide Gradle settings. # IDE (e.g. Android Studio) users: # Gradle settings configured through the IDE *will override* # any settings specified in this file. # For more details on how to configure your build environment visit # http://www.gradle.org/docs/current/userguide/build_environment.html #  Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. org.gradle.jvmargs=-Xmx1536m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true android.enableD8=true android.injected.testOnly=false android.useAndroidX=true android.enableJetifier=trueCopy the code

Problem solved. Seems to be associated with a configuration. ! _!

Cannot access ‘android.viewbinding.ViewBinding’ which is a supertype of ”. Check your module classpath for missing or conflicting dependencies.

// END the problem is resolved. If anyone knows the cause, please leave a comment. Thank you very much.