我正在開始一個Eclipse項目。然後我在Android Studio中遷移。從Git導入時找不到名稱爲'default'的配置
我在Mac上工作,一切正常。 但是,當我嘗試下載我的Git的聲譽在我的電腦,我得到這個消息:
Configuration with name 'default' not found
這裏是我的項目單位:
SP-Mobile
progressWheel (Lib as a project)
sPMobile (Main Project)
build.gradle (1)
build.gradle (top)
settings.gradle (top)
的build.gradle(1)
apply plugin: 'com.android.application'
android {
compileSdkVersion 'Google Inc.:Google APIs:21'
buildToolsVersion "21.1.2"
lintOptions {
abortOnError false
}
defaultConfig {
applicationId "com.spmkt.mobile"
minSdkVersion 16
targetSdkVersion 22
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
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'
}
}
dependencies {
compile project(':progressWheel')
compile 'com.google.code.gson:gson:2.3'
compile 'com.google.android.gms:play-services:+'
compile 'com.android.support:appcompat-v7:22.2.0'
compile files('libs/crashlytics.jar')
compile files('libs/httpcore-4.3.2.jar')
compile files('libs/httpmime-4.3.3.jar')
}
的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:1.2.3'
}
}
allprojects {
repositories {
jcenter()
}
}
最後settings.gradle
include ':progressWheel'
include ':sPMobile'
我做了一些測試,當我刪除依賴於progressWheel,我沒有更多的問題(代碼不能編譯了,但同步成功)
我想我的問題來自這行:
compile project(':progressWheel')
但我不明白,爲什麼一臺電腦上一切正常。而在另一個它失敗!
編輯: 看來,progressWheel像模塊一樣添加,但sPMobile沒有。
progressWheel裏面有一個.iml,但sPMobile沒有。
編輯2:
看來我有我的SP-Mobile.iml紅色,我不知道這意味着什麼,但我IML的lib不紅,所以我能理解.iml MAC之間的性差異和PC ...
這裏是我的.iml項目
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="SP-Mobile"
external.linked.project.path="$MODULE_DIR$"
external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE"
external.system.module.group="" external.system.module.version="unspecified"
type="JAVA_MODULE" version="4">
任何幫助將不勝感激!
我也看到了這種情況,但我忽略了這個信息。 在我使用Android Studio之前,我等待完成所有初始化(同步+構建)。 – Hogun