0

I have changed my target API from 27 to 28 and after that I replaced the Android.jar in Platforms/android-28 with unhiddenjar (to have some systems class for development). After changing from 27 to 28 I am facing an issue with Databinding using classes (around 35 errors)

error: cannot find symbol DataBindingComponent

Sample Error :

18:23:39.878 [ERROR] [system.err] E:\...\app\databinding\FragmentInfoBinding.java:166: error: cannot find symbol
18:23:39.878 [ERROR] [system.err]       @Nullable DataBindingComponent component) {
18:23:39.879 [ERROR] [system.err]                 ^
18:23:39.879 [ERROR] [system.err]   symbol:   class DataBindingComponent
18:23:39.879 [ERROR] [system.err]   location: class FragmentInfoBinding

Tried using the migrate to android x option in android studio and I am already having below line in my gradle.

dataBinding {
        enabled true
    }

My configuration below (ext variables) :

    androidBuildToolsVersion = "28.0.3"
    androidCompileSdkVersion = 28
    androidTargetSdkVersion = 28
    androidMinSdkVersion = 21
    gradleCoreVersion = "4.4"
    gradleAndroidPluginVersion = '3.3.1'

Gradlew Properties :

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

Android Studio :

Android Studio 3.3.1
Build #AI-182.5107.16.33.5264788, built on January 29, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Prabhakaran
  • 1,264
  • 2
  • 20
  • 47

1 Answers1

0

These databinding errors hide the actual error. Try the following method:

  1. Create a new package under java folder androidx.databinding
  2. Inside the package, create an empty interface DataBindingComponent as below:

    public interface DataBindingComponent {}

Run the project, then you will find the actual error. Source

tahsinRupam
  • 6,325
  • 1
  • 18
  • 34
  • yes I tried this way as well and still facing the issue. – Prabhakaran Aug 19 '19 at 00:58
  • You should still face errors but the _cannot resolve symbol DataBindingComponent errors_ should be resolved. Are you still getting 35 errors? – tahsinRupam Aug 19 '19 at 10:35
  • Yes in my solution I am still facing that error. So tried to run the sample with android P modification from https://github.com/ravi8x/Android-DataBindng-RecyclerView and followed the above and I get this issue error: cannot generate view binders com.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.view.View$MeasureSpecMode not found – Prabhakaran Aug 20 '19 at 01:43