我试图将Mosby图书馆添加到我的宠物项目中,但我无法理解如何将它包含到项目中?我尝试添加mosby作为模块->项目,但它没有编译。
请帮我链接一些教程,如何将项目(源代码)添加到我的项目中,然后如何使用它(我的意思是从我的代码访问libs类)。
谢谢!
项目商店在K:\PetProject。莫斯科: K:\mosby。
settings.gradle (我的项目):
include ':app', ':mvp', ':sample-dagger2-rx', ':sample', ':mvp-common', ':viewstate', ':sample-kotlin', ':sample-flow', ':testing', ':sample-mail', ':sample-dagger1'build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta7'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}build.gradle在myproject\app:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "net.simplevolk.mafiagm"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/2'] } }}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
}

发布于 2016-03-19 13:04:46
应该将以下内容添加到您的项目中,方法是将以下内容添加到您的build.gradle at myproject\app中的build.gradle部分,而不是像您如何实现它那样作为一个模块。
compile 'com.hannesdorfmann.mosby:mvp:2.0.1'
compile 'com.hannesdorfmann.mosby:viewstate:2.0.1' // optional viewstate feature至于使用Mosby的教程,Mosby github页面顶部的url链接到有关库的信息,包括关于如何使用它的教程。当我开始使用Mosby时,我发现http://hannesdorfmann.com/mosby/first-app/的示例邮件应用程序很有帮助。
https://stackoverflow.com/questions/36101210
复制相似问题