当我在react-native上运行我的应用程序时:我收到了此消息。
\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.
\android\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.
:app:processDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
这是我的Build Gradle(app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
applicationId "com.example.elviragraciela.prueban"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories{
mavenCentral()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:25.3.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
}
这也是我的构建Gradle(项目)
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// 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(react-native-fbsdk)
apply plugin: 'com.android.library'
android {
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 26
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
compile 'com.facebook.react:react-native:+' // support react-native-v0.22-rc+
}
我正在Windows上运行这个项目,我曾多次尝试将facebook-android-sdk从4.28更改为更新版本,但这引发了com.android.support:appcompat-v7 27.0.2的失败(它请求版本27.0.2哪个android studio还没有它
我还将compileSdkVersion和buildToolsVersion更改为更新的版本,但这还没有奏效。
答案 0 :(得分:0)
首先,AAPT是Android资产打包工具,并且有一些关于如何命名资产的规则。例如,如果我记得很清楚你不能在名字中使用大写字母(pictureNew.png使用picturenew.png)。
然后尝试升级sdk,我现在正在使用它:
compileSdkVersion 26
buildToolsVersion "26.0.2"
和
compile "com.android.support:appcompat-v7:26.0.2"
compile "com.facebook.android:facebook-android-sdk:[4.22.1)"
并检查您的路径中是否包含Android SDK中的平台工具和JAVA sdk路径。