package android.support.v4.app does not exist ; in Android studio 0.8

前端 未结 12 1555
我在风中等你
我在风中等你 2020-12-01 05:24

I\'ve recently updated the android studio IDE to 0.8 to work with the new android L SDK. To start I imported a finished android project that receives no errors in the older

相关标签:
12条回答
  • 2020-12-01 05:44

    In my case the problem was solved by appending the string cordova.system.library.2=com.android.support:support-v4:+ to platforms/android/project.properties file

    0 讨论(0)
  • 2020-12-01 05:46

    For me the problem was caused by a gradle.properties file in the list of Gradle scripts. It showed as gradle.properties (global) and refered to a file in C:\users\.gradle\gradle.properties. I right-clicked on it and selected delete from the menu to delete it. It deleted the file from the hard disk and my project now builds and runs. I guess that the global file was overwriting something that was used to locate the package android.support

    0 讨论(0)
  • 2020-12-01 05:47

    @boernard 's answer solves this from the Android Studio IDE, but if you want to understand what's happening under the covers, it's a simple gradle build file update:

    You can edit the build.gradle file from within the IDE (left pane: Gradle Scripts -> build.gradle (Module: app)) or use the raw path (<proj_dir>/app/build.gradle) and add/update the following dependency section:

    dependencies {
        //
        // IDE setting pulls in the specific version of v4 support you have installed:
        //
        //compile 'com.android.support:support-v4:21.0.3'
    
        //
        // generic directive pulls in any available version of v4 support:
        //
        compile 'com.android.support:support-v4:+'
    }
    

    Using the above generic compile directive, allows you to ship your code to anyone, provided they have some level of the Android Support Libraries v4 installed.

    0 讨论(0)
  • 2020-12-01 05:48

    My solution was creating a project with Use legacy support library option checked. after the project creation is successfully completed, just delete the src folder in the app directory and copy the src folder from your main project. Finally, Sync project with Gradle files.

    0 讨论(0)
  • 2020-12-01 05:49

    Ok, so I had the same problem and found a solution in a udacity forum:

    In Android Studio:

    1. Right click on your projects "app" folder and click on -> module settings
    2. Click on the "dependencies" tab
    3. Click on the + sign to add a new dependency and select "Library Dependency"
    4. Look for the library you need and add it
    0 讨论(0)
  • 2020-12-01 05:49

    Delete

    /.idea/libraries
    

    Then sync gradle to build project.

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