Reputation: 36205
I am trying to make use of Android Studio, currently using Eclipse.
I have exported my Library project for gradle, and then imported my exported project into Android Studio. This is successful, however I then can't find how I can go to my main applications project and reference the newly imported library. Everything I've found looking though Android Studio, always seems to be for creating a new library project, not referencing an existing project.
I am using Android Studio 0.4.0.
Thanks for any help you can provide.
UPDATE
I've looked at what @Grennis said, but I do not have a library section under the Project Structure Dialogue. Below is a screenshot of my project structure dialogue.
UPDATE 2
I've been trying to modify the gradle files manually, I've read that the library needs to be copied to my project and then reference it within the gradle files. I think this may be sort of working as I kept on getting errors stating that it couldn't find the library, however, I am no longer getting that error and I'm getting a different one instead.
The error is:
A problem occurred configuring project ':MysqlManager'.
Configuration with name 'default' not found.
- Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Below is my settings.gradle
include ':MysqlManager'
include ':Libraries:CritiMon'
Below is my build.gradle file
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.7.+'
}
}
apply plugin: 'android'
repositories {
mavenCentral()
}
android {
compileSdkVersion 19
buildToolsVersion "17.0.0"
defaultConfig {
minSdkVersion 7
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile project(':Libraries:CritiMon')
// compile project(':Libraries:NavigationDrawerManager')
// compile project(':Libraries:BoardiesITSolutionsLib')
}
Below is a screenshot showing my directory structure
Upvotes: 0
Views: 811
Reputation: 80010
This question has been asked many times.
using facebook sdk in android studio
Import module to gradle project on android studio 0.4.0v
Import module or project as Library on Android Studio
How to import eclipse library project from github to android studio project?
Problems adding external library to Android Studio 0.3.6
Android studio import module button missing
Can't find import module option in project structure (Android Studio 0.3.4 - 0.5.2)
Cannot import module in Android Studio 0.3.5
The issue with the Configuration with name 'default' not found error has also been asked many times:
Android Studio Gradle Configuration with name 'default' not found
Problems trying to create gradle build
Configuration with name 'default' not found while building android project on gradle
Upvotes: 1
Reputation: 15379
Select your project and then in the menu select File -> Project Structure
In the "Libraries" section you can add existing libraries
Then in the "Modules" section, under the "Dependencies" tab, you can add those libraries to the project.
Upvotes: 0