引用现有图书馆项目为主营项目 [英] Referencing Existing Library Project into Main Project

查看:128
本文介绍了引用现有图书馆项目为主营项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想利用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.

<一个href="http://stackoverflow.com/questions/19961828/using-facebook-sdk-in-android-studio/20221453#20221453">using Facebook的SDK中的机器人工作室

<一个href="http://stackoverflow.com/questions/20770118/import-module-to-gradle-project-on-android-studio-0-4-0v/20816959#20816959">Import模块在Android工作室0.4.0v摇篮工程

<一个href="http://stackoverflow.com/questions/20745210/import-module-or-project-as-library-on-android-studio/20749014#20749014">Import模块或项目作为图书馆在Android工作室

<一个href="http://stackoverflow.com/questions/20310164/how-to-import-eclipse-library-project-from-github-to-android-studio-project/20319616#20319616">How从github上导入Eclipse库项目到Android Studio项目?

<一个href="http://stackoverflow.com/questions/20080494/problems-adding-external-library-to-android-studio-0-3-6/20319340#20319340">Problems增加外部库到Android工作室0.3.6

<一个href="http://stackoverflow.com/questions/20228507/android-studio-import-module-button-missing/20229243#20229243">Android工作室导入模块按钮缺少

<一个href="http://stackoverflow.com/questions/19898456/cant-find-import-module-option-in-project-structure-android-studio-0-3-4-0-3/20054824#20054824">Can't发现在项目结构导入模块选件(机器人工作室0.3.4 - 0.3.6)

<一个href="http://stackoverflow.com/questions/19981666/cannot-import-module-in-android-studio-0-3-5/19983440#19983440">Cannot在Android的工作室导入模块0.3.5

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

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

<一个href="http://stackoverflow.com/questions/17188489/android-studio-gradle-configuration-with-name-default-not-found">Android工作室摇篮配置名为'默认'未找到

问题试图创建摇篮构建

<一个href="http://stackoverflow.com/questions/18178267/configuration-with-name-default-not-found-while-building-android-project-on-gr">Configuration名为默认没有找到,而在摇篮

build.gradle和项目库

这篇关于引用现有图书馆项目为主营项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆