我試圖通過從GitHub中檢查git來將我的項目重新回到以前的版本,但我認爲我是以錯誤的方式完成的。我剛剛刪除了本地項目,並檢出了android studio上的git地址。但是,Gradle無法構建並顯示此消息:未找到Gradle構建錯誤樣式屬性
我導航到說找不到樣式attr的行,並選擇查找用法,但它說在此項目中沒有用法。我也嘗試刪除Twitter工具包並重新加載,並加載較舊的版本,兩者仍然存在此問題。如何解決這個問題?
該項目是從android studio 3.0 canary開始構建的。這是應用程序文件的gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "..."
minSdkVersion 19
targetSdkVersion 26
versionCode 3
versionName "beta1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:26.0.0'
compile 'com.android.support:recyclerview-v7:26.0.0'
compile 'com.twitter.sdk.android:twitter:3.1.0'
compile 'com.jakewharton:butterknife:8.7.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.8.1'
compile 'com.github.bumptech.glide:glide:3.7.0'
annotationProcessor 'com.github.bumptech.glide:glide:3.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
implementation 'com.android.support:appcompat-v7:26.0.0'
implementation 'com.android.support:design:26.0.0'
}
而另一構建文件:
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha9'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
你可以試試'Build/Clean Project'然後'File/Invalidate Caches Restart'嗎?原因是如果存在合併/生成的XML和來自git的外部更新,那麼生成的XML可能引用了來自上游的類 –
是的,在此回滾版本中,某些xml文件已消失,並且不會生成引用錯誤。我想我在合併時選擇了錯誤的基本分支。非常感謝!@DavidRawson – Robin