引用现有图书馆项目为主营项目项目、图书馆

由网友(Britney、暮光)分享简介:我想利用Android的工作室,目前使用的Eclipse。 I am trying to make use of Android Studio, currently using Eclipse. 我已经远销我的图书馆项目摇篮,然后输入我的出口项目到Android的工作室。这是成功的,但是我再怎么找不到我可以去我的主...

我想利用Android的工作室,目前使用的Eclipse。

I am trying to make use of Android Studio, currently using Eclipse.

我已经远销我的图书馆项目摇篮,然后输入我的出口项目到Android的工作室。这是成功的,但是我再怎么找不到我可以去我的主要应用项目,并引用新导入的库。一切我发现看,虽然Android的工作室,似乎总是创建一个新的库项目,而不是引用现有的项目。

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.

我使用的是Android 0.4.0工作室。

I am using Android Studio 0.4.0.

感谢您的帮助,您可以提供。

Thanks for any help you can provide.

更新

我已经看了什么@Grennis说,但我没有在项目结构对话的库部分。下面是我的项目结构的对话截图。

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.

更新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.

该错误是:

发生配置项目中的问题:MysqlManager。

A problem occurred configuring project ':MysqlManager'.

配置名为'默认'未找到。

Configuration with name 'default' not found.   尝试:用--stacktrace运行选项获取堆栈跟踪。与--info或--debug选项运行,以获得更多的日志输出。   

下面是我的settings.gradle

Below is my settings.gradle

include ':MysqlManager'
include ':Libraries:CritiMon'

下面是我的build.gradle文件

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

推荐答案

这个问题已经被问了很多次。

This question has been asked many times.

using Facebook的SDK中的机器人工作室

Import模块在Android工作室0.4.0v摇篮工程

Import模块或项目作为图书馆在Android工作室

How从github上导入Eclipse库项目到Android Studio项目?

Problems增加外部库到Android工作室0.3.6

Android工作室导入模块按钮缺少

Can't发现在项目结构导入模块选件(机器人工作室0.3.4 - 0.3.6)

Cannot在Android的工作室导入模块0.3.5

与配置名称为默认找不到的错误也被问了很多次的问题:

The issue with the Configuration with name 'default' not found error has also been asked many times:

Android工作室摇篮配置名为'默认'未找到

问题试图创建摇篮构建

Configuration名为默认没有找到,而在摇篮

build.gradle和项目库

阅读全文

相关推荐

最新文章