今天我将Android Studio更新为ver。 3.0然后我在布局编辑器中出错:
这是我的gradle文件:
apply plugin: 'com.android.application'
android {
def version = "2.4"
def milestone = "1"
def build = "5"
def name = "WOMS" + "v" + version
compileSdkVersion 23
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "hr.aprox_it.womsmobile"
minSdkVersion 16
targetSdkVersion 23
versionCode 1
versionName "1.5"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
appendVersionName(variant, defaultConfig)
}
}
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/2'] } }
}
def appendVersionName(variant, defaultConfig) {
variant.outputs.each { output ->
if (output.zipAlign) {
//def file = output.outputFile
//def fileName = file.name.replace("app-debug.apk", "WomsMobile-" + defaultConfig.versionName + "v.apk")
//output.outputFile = new File(file.parent, fileName)
}
//def file = output.packageApplication.outputFile
//def fileName = file.name.replace("app-debug.apk", "WomsMobile-" + defaultConfig.versionName + "v.apk")
//output.packageApplication.outputFile = new File(file.parent, fileName)
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:23.4.0'
testCompile 'junit:junit:4.12'
}
有人遇到过这个问题吗? 似乎每次更新Android Studio和SDK旧项目都有问题。
更新
在styles.xml中的我改变了:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
到
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
那解决了问题......我猜......没有任何渲染错误了。我想听听其他人如果有这个问题他们如何解决这个问题。