【发布时间】:2018-04-07 03:08:15
【问题描述】:
今天我将 Android Studio 更新到了版本。 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">
问题解决了……我猜……没有更多的渲染错误了。如果有的话,我想听听其他人如何解决这个问题。
【问题讨论】:
-
所以你没有任何带有 alignParent 东西的线性布局?
标签: android android-studio android-gradle-plugin render