源集Android Studio
我在Android Studio上有一个项目,在其gradle文件中包含sourceSet,在Windows上该项目工作正常,我将代码从我们的Git服务器拉到Mac OS X 10.10,出现问题,模块“app”被读取为文件而不是项目。只有从build.gradle中删除“sourceSet”,它才能工作,但如果我删除它,我的布局将导致问题,因为我的布局文件夹确实有子文件夹 我正在Windows和Mac上使用最新的Android Studio(Android Studio v1.4 RC 1和Gradle 1.3.0) 请告知 我的build.gradle是:源集Android Studio,android,git,gradle,Android,Git,Gradle,我在Android Studio上有一个项目,在其gradle文件中包含sourceSet,在Windows上该项目工作正常,我将代码从我们的Git服务器拉到Mac OS X 10.10,出现问题,模块“app”被读取为文件而不是项目。只有从build.gradle中删除“sourceSet”,它才能工作,但如果我删除它,我的布局将导致问题,因为我的布局文件夹确实有子文件夹 我正在Windows和Mac上使用最新的Android Studio(Android Studio v1.4 RC 1和G
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion '23.0.1'
defaultConfig {
applicationId "x.y"
minSdkVersion 15
targetSdkVersion 18
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
manifest.srcFile '/src/main/AndroidManifest.xml'
java.srcDirs = ['/src/main/java', '.apt_generated']
aidl.srcDirs = ['/src/main/aidl', '.apt_generated']
assets.srcDirs = ['/src/main/assets']
res.srcDirs =
[
'/src/main/res',
'/src/main/res/layout',
'/src/main/res/layout/cards',
'/src/main/res/layout/intro',
'/src/main/res/layout/customviews',
'/src/main/res/layout/droppy'
]
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.alibaba:fastjson:1.2.6'
compile 'com.marvinlabs:android-floatinglabel-widgets:1.6.1@aar'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.google.android.gms:play-services-gcm:7.+'
compile 'com.parse.bolts:bolts-android:1.2.0'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
compile 'com.prolificinteractive:material-calendarview:0.4.0'
compile 'com.android.support:cardview-v7:23.0.1'
compile 'com.github.PhilJay:MPAndroidChart:v2.1.0'
compile 'com.google.android.gms:play-services-maps:7.+'
compile 'uk.me.lewisdeane.ldialogs:ldialogs@aar'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'co.uk.rushorm:rushandroid:1.1.7'
// Check https://github.com/panwrona/DownloadProgressBar
//compile 'com.github.panwrona:DownloadProgressBar:1.1'
// Check https://github.com/TakeoffAndroid/MaterialDialogBottomSheet
compile project(':supertoasts')
compile project(':library')
compile project(':Droppy')
compile project(':tutorial_view')
compile project(':appintrolib')
compile project(':Slidr')
compile project(':circularprogressbutton')
compile project(':android_week_view')
compile 'com.google.guava:guava:19.0-rc1'
}尝试在路径之前添加
。/app
,例如:
'/src/main/res'->'../app/src/main/res'
编辑:对不起,我错过了“.”。我试过了,现在可以用了。谢谢你的帮助