當我在PC上工作時,我已經成功構建了一個項目,並在遷移到OSX之前將其提交到我的Git倉庫。OS Studio上的舊版和新版Gradle構建失敗
現在,我在OSX上安裝了Android Studio最新版本,並嘗試構建相同的項目,並在構建資源時出現錯誤。雖然在清單建設資源,它提供了多種的錯誤,說
沒有資源發現在給定的名字
爲可繪製和字符串相匹配。
在瀏覽網頁時,我想也許更新版本的gradle有一些問題。所以,我將AS的安裝降級到AS 1.0,並使用舊的gradle 2.2。不幸的是,這個版本的gradle也給出了同樣的錯誤。
我build.gradle
看起來象下面這樣:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "xxx"
minSdkVersion 16
targetSdkVersion 21
versionCode 4
versionName "1.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {
res.srcDirs = [
"/src/main/res"
]
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/thermodosdk-1.0.18.jar')
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.android.support:support-v4:21.0.3'
的build.gradle
在頂層有以下類路徑:
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
}
堆棧跟蹤:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugTestSources]
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72103Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42103Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices6587Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
/Users/vidhigoel/AndroidStudioProjects/OMGAndroid/app/build/intermediates/manifests/full/debug/AndroidManifest.xml
Error:(24, 23) No resource found that matches the given name (at 'icon' with value '@drawable/omg_app_icon').
Error:(25, 24) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(27, 24) No resource found that matches the given name (at 'theme' with value '@style/AppTheme').
Error:(30, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(86, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(105, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(123, 28) No resource found that matches the given name (at 'label' with value '@string/app_name').
Error:(137, 28) No resource found that matches the given name (at 'label' with value '@string/title_activity_register_user').
...
Information:BUILD FAILED
Information:Total time: 4.462 secs
Information:17 errors
Information:0 warnings
Information:See complete output in console
請幫我解決這個問題。
你可以張貼你的實際錯誤,如果可能的話,堆棧跟蹤。 – RaGe
請發佈錯誤日誌以便於跟蹤 –