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
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
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
@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.
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.
Ok, so I had the same problem and found a solution in a udacity forum:
In Android Studio:
Delete
/.idea/libraries
Then sync gradle to build project.