Could not initialize class android.support.design.widget.CoordinatorLayout

后端 未结 8 1987
臣服心动
臣服心动 2020-12-11 00:17

I am trying to use the CoordinatorLayout from the new Android design library. I added the package to gradle; then I try to use the layout I get this error:

j         


        
相关标签:
8条回答
  • 2020-12-11 01:13

    Restarting Android Studio fixed the problem for me, hope this helps...

    0 讨论(0)
  • 2020-12-11 01:14

    I ran into it using the latest Mac OS X, latest SDK and latest Android Studio. All of them are "stable" versions. Shame on Google testers.

    How I fixed it:

    1. From menu: Tools > Android > SDK manager
    2. In the SDK Manager, check Android 5.0.1 (API 21). Perhaps any other will do.
    3. Click "Show package details" at the bottom. Under Android 5.0.1, also check "Google APIs" and "Intel x86 Atom System Image" (why not? if we'll develop for the 21th API)
    4. Click OK and wait for the components to download.
    5. Like already mentioned in other answers, choose to render the layout with it:

    Problem solved!

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