Android Studio “cannot resolve symbol” but project compiles and works

后端 未结 13 2292
我在风中等你
我在风中等你 2020-12-24 10:49

The project compiles fine. However, Android studio 3.0.1 shows reference to one particular library in red and displays \"cannot resolve symbol\". Even single stepping into

13条回答
  •  太阳男子
    2020-12-24 11:27

    In my case changing the Gradle version worked.

    In gradle-wrapper.properties

    changing

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

    to

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

    and in build.gradle (project level)

    changing

    classpath 'com.android.tools.build:gradle:3.3.0'
    

    to

    classpath 'com.android.tools.build:gradle:3.2.1'
    

提交回复
热议问题