2014-12-06 104 views
0

我不得不在Intelij 12.1.4編譯的罰款項目,但我想用,因爲XML編輯器的機器人工作室。我的問題是這樣的,當我試圖將項目導入到Android的工作室1.0 RC 4的第一個錯誤我得到的是:「你必須使用Android搖籃插件的更新版本支持的最低版本爲0.14.0」導入InteliJ項目到Android工作室

我原來的build.gradle文件包含:

dependencies { 
    classpath 'com.android.tools.build:gradle:0.5+' 
} 

現在只是將其更改爲閱讀:

dependencies { 
    classpath 'com.android.tools.build:gradle:0.14.0' 
} 

導致此錯誤:

Error:(17, 0) Could not find property 'files' on org.gradle.api.interna[email protected]2e93ad. 

什麼嘗試任何建議?我的整個Build.gradle文件低於

buildscript { 
repositories { 
    mavenCentral() 
} 
dependencies { 
    classpath 'com.android.tools.build:gradle:0.14.0' 
} 
} 
apply plugin: 'android' 

dependencies { 
compile files('libs/android-support-v4.jar') 
compile files('libs/android-support-v7.jar') 
//compile files('libs/GoogleAdMobAds.jar') 
compile files('libs/libGoogleAnalyticsV2') 
compile files('libs/google-play-services.jar') 
compile files 'com.android.support:appcompat-v7:+' 

compile files 'com.google.android.gms:play-services:4.0.30' 
compile files('libs/amazon-ads-5.4.46.jar') 

} 

android { 
compileSdkVersion 17 
buildToolsVersion "17.0.0" 

defaultConfig { 
    minSdkVersion 7 
    targetSdkVersion 16 
} 
} 

回答

1

此錯誤消息是因爲您的兩個依賴性語句無效。

compile files 'com.android.support:appcompat-v7:+' 
compile files 'com.google.android.gms:play-services:4.0.30' 

應該是:

compile 'com.android.support:appcompat-v7:+' 
compile 'com.google.android.gms:play-services:4.0.30' 

不過,我會強烈建議您返工支持和谷歌圖書館的其他依賴。最好的做法是不要將這些文件作爲jar文件包含進來,而應該像通過appcompat和Play Services庫一樣通過Maven座標訪問它們。 (事實上​​,因爲你已經包含了這裏展示的Play服務庫,所以你不需要包含它的jar)。

如果您刪除這些依賴性語句並轉至項目結構>(您的模塊)>依賴項> +>庫依賴項它應該可以幫助您。

另外,使用+符號的程序兼容性依賴性應勸阻;如果庫更新在您的下面,它可能會導致意外的構建損壞。 「項目結構」對話框可以幫助您提供此依賴項的顯式版本號。

相關問題