【问题标题】:The import android.support.design.widget.FloatingActionButton cannot be resolved[Eclipse]导入android.support.design.widget.FloatingActionButton无法解析[Eclipse]
【发布时间】:2016-07-14 11:30:32
【问题描述】:

无法解析导入的android.support.design.widget.FloatingActionButton[Eclipse]

项目构建目标-API 23

<uses-sdk android:minSdkVersion="18" android:targetSdkVersion="22" />

添加 jar lib 文件夹:

android-support-v7-appcompat.jar

appcompat-v7-23.1.1-sources.jar

design-23.1.1-sources.jar

【问题讨论】:

  • 您使用哪个 IDE 进行开发? Android Studio 还是 Eclipse? bcz 你同时标记了这两个
  • @OnkarNene,拒绝您在下面回答的编辑。改为添加您自己的答案。

标签: android eclipse android-layout


【解决方案1】:

无法解析类

android.support.design.widget.FloatingActionButton

用这个

com.google.android.material.floatingactionbutton.FloatingActionButton

【讨论】:

  • 我可以在Android Studio中成功预览它。但是当我尝试编译它时,它会报告一个错误:“Error inflating class com.google.android.material.floatingactionbutton.FloatingActionButton”我的@ 987654323@: 'androidx.appcompat:appcompat:1.1.0' 'com.google.code.gson:gson:2.8.6' 'androidx.constraintlayout:constraintlayout:1.1.3' 'com.google.android.material:material :1.1.0''com.android.support:design:27.1.1''com.android.support:appcompat-v7:27.1.1'junit:junit:4.12'androidx.test:runner:1.1.1'' androidx.test.espresso:espresso-core:3.1.1'
【解决方案2】:

如果您使用的是 Android Studio -

然后尝试将其添加到您的build.gradle(应用级别)

compile 'com.android.support:design:23.1.1' 
compile 'android-support-v7-appcompat:23.1.1'

因为您的目标是 API 23

【讨论】:

  • 能否提供只下载jar的链接?
  • 好的,Eclipse Android 呢?
猜你喜欢
  • 2020-09-21
  • 2013-03-03
  • 1970-01-01
  • 1970-01-01
  • 2017-03-25
  • 2018-10-28
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多