以下 类 无法实例化:- android.support.design.widget.FloatingActionButton
The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton
我收到以下错误
The following classes could not be instantiated: -
android.support.design.widget.FloatingActionButton
最近每次我在 Android Studio 中打开新项目时都会出现这个问题,
我尝试了这里写的很多解决方案,比如 ..
- 使用 gradle 选项重建并重新同步项目。
- 更改Android渲染版本。
- 正在检查更新并安装最新版本。
None 这些解决方案对我有用。
像这样尝试更新 "build.gradle (Module.app)":
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-annotations:23.2.1'
compile 'com.android.support:design:23.2.1'
}
...
并重新同步项目。它帮助了我
我在 res/values/styles.xml
中找到了改变项目主题的解决方案
<stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
成功了。
我收到以下错误
The following classes could not be instantiated: - android.support.design.widget.FloatingActionButton
最近每次我在 Android Studio 中打开新项目时都会出现这个问题, 我尝试了这里写的很多解决方案,比如 ..
- 使用 gradle 选项重建并重新同步项目。
- 更改Android渲染版本。
- 正在检查更新并安装最新版本。
None 这些解决方案对我有用。
像这样尝试更新 "build.gradle (Module.app)":
...
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-annotations:23.2.1'
compile 'com.android.support:design:23.2.1'
}
...
并重新同步项目。它帮助了我
我在 res/values/styles.xml
中找到了改变项目主题的解决方案<stylename="AppTheme"parent="Theme.AppCompat.Light.DarkActionBar">
成功了。