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

前端 未结 16 1025
轻奢々
轻奢々 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.

提交回复
热议问题