Cannot resolve symbol 'support' (using Android Studio, following getting started guide)

后端 未结 3 1740
耶瑟儿~
耶瑟儿~ 2021-02-09 10:40

I am getting started with Android development. I have followed this Getting Started guide and use Android Studio (not eclipse).

I ran Hello World on my

相关标签:
3条回答
  • 2021-02-09 11:03

    Modify your gradle file like below and try if it works.

    ......
    
        dependencies {
           compile 'com.android.support:support-v4:18.0.0'
    
            // You must install or update the Support Repository through the SDK manager to use this dependency.
            // The Support Repository (separate from the corresponding library) can be found in the Extras category.
            // compile 'com.android.support:appcompat-v7:18.0.0'
        }
    
    0 讨论(0)
  • 2021-02-09 11:03

    Fix in Android Studio using the GUI, without the direct editing of the Gradle files (validated for Android Studio starting v1.0.1 to v2.2.3):

    1. Right-click your module in the project tree. It is one, in most cases the first, of the root nodes. By default, it is called app.

    2. In the menu choose Open Module Settings:

      enter image description here

    3. Switch to Dependencies tab.

    4. Click the add button (+) at the bottom of the dialog window.

    5. Choose Library Dependency.

    6. Choose support-v4 from the list.

    7. Click OK and rebuild.

    0 讨论(0)
  • 2021-02-09 11:14

    Instead of editing the build.gradle I did it the maven way with right mouse on your root project -> Open Module Settings -> Dependencies Tab -> + -> Maven Dependency -> Search For "NavUtils" and select com.google.android:support-v4:r7@jar.

    SDK Version 19 and Android Studio 0.4.2

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