Failed to resolve variable '${animal.sniffer.version}' when migrate to AndroidX

前端 未结 16 1028
轻奢々
轻奢々 2021-01-30 04:36

I\'m using Android Studio 3.2 Beta5 to migrate my project to AndroidX. When I rebuild my app I got these errors:

ERROR: [TA

相关标签:
16条回答
  • 2021-01-30 05:33

    I faced this error after adding butterknife to my project.

    In order to resolve this error you should use Java8.

    I would recommend this answer.

    How I resolved it:

    1.add following code in build.gradle (module: app)

    android {
      ...
      // Configure only for each module that uses Java 8
      // language features (either in its source code or
      // through dependencies).
      compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
      }
    }
    
    1. clean prject and run.
    0 讨论(0)
  • 2021-01-30 05:35

    If you are using dagger or butterknife, please make sure to update it to the latest version. Or, if you have another injection library used in your project, you can try to check it if it support androidx or no.

    I've found same error, the problem is on my dagger and butterknife. Have fixed it by updating it to newest version.

    0 讨论(0)
  • 2021-01-30 05:37

    Try set android.enableJetifier=false in gradle.properties. Then Invalidate Caches / Restart ... in Android Studio

    0 讨论(0)
  • 2021-01-30 05:37

    I fixed this by updating the firebase dependencies to the latest.

    0 讨论(0)
提交回复
热议问题