Android Studio FloatingActionButton error

后端 未结 7 844
小鲜肉
小鲜肉 2020-12-05 17:26

I installed Android Studio yesterday, and after battling multiple java and other errors, I have come to an error that I cannot seem to fix. I have not added anything or done

相关标签:
7条回答
  • 2020-12-05 17:58

    also update gradle version you're using for compiling, e.g. 2.13 instead of 2.9/2.10 which fails with higher support libs usually

    easiest is to to a gradle task in your main build.gradle:

    task wrapper(type: Wrapper) {
      gradleVersion = '2.13'
    }
    

    and then run it with

    gradle wrapper
    
    0 讨论(0)
  • 2020-12-05 18:00

    That error pops up if any of the following things happen :

    1. You don't have the latest SDK versions installed. Make sure you have the right versions. You need to have Android M installed to use the floating action button. (Use the Android SDK Installer)

    2. Your gradle dependencies are wrong.

    If you are new to Android Studios, chances are the problem is both 1 and 2.

    For the 2nd issue, go to your gradle file and put this in :

    dependencies {
        compile 'com.android.support:design:23.0.0'
    }
    

    That should fix the issue.

    0 讨论(0)
  • 2020-12-05 18:09

    This worked for me:

    I changed in the build.gradle file.

    compile 'com.android.support:design:23.2.0'

    to

    compile 'com.android.support:design:23.1.0'

    Then clean, rebuild, then "refresh" each layout file. The refresh button on the top right in the layout editor.

    0 讨论(0)
  • 2020-12-05 18:12

    In addition to the change detailed in @Handrata Samsul's answer, I also had to make another change in the build.gradle file.

    Modify:

    compile 'com.android.support:appcompat-v7:23.2.0'
    

    to become:

    compile 'com.android.support:appcompat-v7:23.1.0'
    

    Therefore, the sum of all changes were as follows:

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

    Thanks.

    0 讨论(0)
  • 2020-12-05 18:14

    android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1080029

    This exception is thrown by the resource APIs when a requested resource can not be found.

    You should use stable version .You can then start using the Design library with a single new dependency with :

    Do

    compile 'com.android.support:design:23.1.0'
    

    Then Clean-Rebuild-Sync Your IDE .Hope this helps .

    Don't

    compile 'com.android.support:design:23.2.0'
    

    Version 23.2.0 is buggy .Its not stable . You should go for stable above version 23.1.0 .

    0 讨论(0)
  • 2020-12-05 18:16

    I also got this problem today,

    Check your build.gradle file, do you use support design lib version 23.2, like

    compile 'com.android.support:design:23.2.0'
    

    if so, change it to version 23.1.0

    compile 'com.android.support:design:23.1.0'
    

    then rebuild your project... seems version 23.2 is still buggy

    0 讨论(0)
提交回复
热议问题