不能设置浮点操作按钮的类不能被找到(Android的工作室) [英] Cannot setup floating action buttons as class cannot be found (Android Studio)

查看:184
本文介绍了不能设置浮点操作按钮的类不能被找到(Android的工作室)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我pretty新Android和我试图建立与的 Android设计支持库使用的 Android Studio中本指南

So I am pretty new to android and I am trying to setup a floating action button with the Android Design Support Library using this guide in Android Studio.

我的项目:注意到的build.gradle文件:

My Project: Noted build.gradle file:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.2.3'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我的模块:应用程序的build.gradle文件:

My Module: app build.gradle file:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.example.noted"
        minSdkVersion 21
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.android.support:support-v4:22.2.0'
    compile 'com.android.support:design:22.2.0'
}

在我的 activity_main.xml中我尝试实施

<android.support.design.widget.FloatingActionButton 
    ... />

但我得到的呈现问题的弹出窗口之一,建设后说:

but I get one of those Rendering Problems pop ups after building saying:

以下类找不到:
  -android.support.design.widget.FloatingActionButton

The following classes could not be found: -android.support.design.widget.FloatingActionButton

我的猜测是,我做错了我的依赖,但我真的不知道。我一直试图让这几个小时,没有运气的工作,并会真的AP preciate任何帮助。

My guess is that I'm doing something wrong with my dependencies but I really have no idea. I have been trying to get this to work for hours with no luck and would really appreciate any help.

谢谢!

推荐答案

我有同样的问题,并更新了Android的支持库,Android的支持库(22.2.1)和Android SDK中工具(24.1.2 )使用SDK管理器现在它的工作的罚款。一旦完成更新改造项目。欲了解更多 HTTPS ://developer.android.com/tool​​s/support-library/setup.html

I had the same issue and updated the Android Support Repository", "Android Support Library"(22.2.1) and "Android SDK Tool"(24.1.2) using SDK manager now its working fine. Once update finish rebuild the project. For more https://developer.android.com/tools/support-library/setup.html

这篇关于不能设置浮点操作按钮的类不能被找到(Android的工作室)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆