gpt4 book ai didi

android - AAPT2 错误 : check logs for details(Build failed)

转载 作者:行者123 更新时间:2023-11-29 23:58:26 26 4
gpt4 key购买 nike

我刚刚回到我的旧项目,因为我一直没有在它上工作,我发现很多错误作为 gradle 中的构建错误,因为我使用编译而不是实现和我试图解决的许多其他过程这个错误很多但我失败了as this my window error那是我无法识别的,因为我还使用了 github 中的旧库

这是 myGradle (build.gradle(Project:Waiterer))

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

这是 build.gradle(Module:app)

apply plugin: 'com.android.application'

android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "abtech.waiteriano.com.waitrer"
minSdkVersion 18
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation project(':jtds-1.3.1')
implementation project(':library')
implementation project(':librarySV')
implementation 'com.android.support:support-v4:25.2.0'
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:25.3.1'
implementation 'com.roughike:bottom-bar:1.3.9'
implementation 'com.android.support:recyclerview-v7:25.2.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-alpha8'
implementation 'com.github.clans:fab:1.6.2'
implementation 'de.hdodenhof:circleimageview:1.3.0'
implementation 'com.android.support:cardview-v7:25.3.1'
testImplementation 'junit:junit:4.12'
implementation "com.android.support:gridlayout-v7:23.1.1"
}

这是我使用的第一个 gradle 库build.gradle(模块:库)

apply plugin: 'com.android.library'

android {
compileSdkVersion 23
buildToolsVersion '27.0.3'

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
}

这是我使用的第二个图书馆build.gradle(模块:librarySV)

apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.novoda:bintray-release:0.8.1'
}
}

android {
compileSdkVersion 23
buildToolsVersion '25.0.0'

defaultConfig {
minSdkVersion 14
targetSdkVersion 23
versionCode 1
versionName "1.4.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:23.1.1'
implementation 'com.android.support:design:23.1.1'
}

publish {
userOrg = 'miguelcatalan'
groupId = 'com.miguelcatalan'
artifactId = 'materialsearchview'
publishVersion = '1.4.0'
desc = 'Cute library to implement SearchView in a Material Design Approach'
website = 'https://github.com/MiguelCatalan/MaterialSearchView'
}

希望这能足够清楚如果有什么不清楚的告诉我请注意:我没有使用 API 我使用 JDBC JTDS 连接从数据库中检索数据

最佳答案

问题是开发人员仍然对新 AS 感到不舒服。显示错误的方式已更改(现在很奇怪)。

首先 在构建错误中向下滚动。如果您看到错误,请单击以将其展开。它很可能会向您显示错误。

enter image description here

其次如果这不起作用(就像我在数据绑定(bind)中遇到的那样,没有显示任何错误)

然后尝试使用调试或堆栈跟踪进行构建

转到

File > Settings > Build, Execution, Deployment > Compiler

像这样添加(添加--stacktrace--debug),它会记录异常。您可以查看导致问题的原因。

screenshot

关于android - AAPT2 错误 : check logs for details(Build failed),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50157912/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com