- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 React Native,并在构建过程中收到此错误。我很确定这是因为 SDK 和支持库之间不匹配,但我找不到正确的值。我应该使用什么 SDK 版本和支持库。请帮助我,我真的处于困境。
:app:processDebugResources/Users/hg/Downloads/ecoway/android/app/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
/Users/hg/Downloads/ecoway/android/app/build/intermediates/res/merged/debug/values-v26/values-v26.xml:18:21-54: AAPT: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
/Users/hg/Downloads/ecoway/android/app/build/intermediates/res/merged/debug/values-v26/values-v26.xml:15: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
/Users/hg/Downloads/ecoway/android/app/build/intermediates/res/merged/debug/values-v26/values-v26.xml:18: error: Error: No resource found that matches the given name: attr 'android:keyboardNavigationCluster'.
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
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
应用程序/build.gradle
apply plugin: "com.android.application"
import com.android.build.OutputFile
/**
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
* and bundleReleaseJsAndAssets).
* These basically call `react-native bundle` with the correct arguments during the Android build
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
* bundle directly from the development server. Below you can see all the possible configurations
* and their defaults. If you decide to add a configuration block, make sure to add it before the
* `apply from: "../../node_modules/react-native/react.gradle"` line.
*
* project.ext.react = [
* // the name of the generated asset file containing your JS bundle
* bundleAssetName: "index.android.bundle",
*
* // the entry file for bundle generation
* entryFile: "index.android.js",
*
* // whether to bundle JS and assets in debug mode
* bundleInDebug: false,
*
* // whether to bundle JS and assets in release mode
* bundleInRelease: true,
*
* // whether to bundle JS and assets in another build variant (if configured).
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
* // The configuration property can be in the following formats
* // 'bundleIn${productFlavor}${buildType}'
* // 'bundleIn${buildType}'
* // bundleInFreeDebug: true,
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
* // where to put the JS bundle asset in debug mode
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
*
* // where to put the JS bundle asset in release mode
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in debug mode
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
*
* // where to put drawable resources / React Native assets, e.g. the ones you use via
* // require('./image.png')), in release mode
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
*
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/
project.ext.react = [
entryFile: "index.js"
]
apply from: "../../node_modules/react-native/react.gradle"
/**
* Set this to true to create two separate APKs instead of one:
* - An APK that only works on ARM devices
* - An APK that only works on x86 devices
* The advantage is the size of the APK is reduced by about 4MB.
* Upload all the APKs to the Play Store and people will download
* the correct one based on the CPU architecture of their device.
*/
def enableSeparateBuildPerCPUArchitecture = false
/**
* Run Proguard to shrink the Java bytecode in release builds.
*/
def enableProguardInReleaseBuilds = false
android {
compileSdkVersion 25
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "com.ecoway"
minSdkVersion 16
targetSdkVersion 25
multiDexEnabled = true
versionCode 1
versionName "1.0"
vectorDrawables.useSupportLibrary = true
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
}
}
buildTypes {
release {
minifyEnabled enableProguardInReleaseBuilds
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
}
}
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
}
}
}
}
dependencies {
compile project(':tipsi-stripe')
compile project(':react-native-maps')
compile ("com.google.android.gms:play-services-base:10.0.1") {
force = true;
}
compile ("com.google.android.gms:play-services-maps:10.0.1") {
force = true;
}
compile ("com.google.android.gms:play-services-gcm:10.0.1") {
force = true;
}
compile ('com.google.firebase:firebase-core:10.0.1') {
force = true;
}
compile ('com.google.firebase:firebase-messaging:10.0.1') {
force = true;
}
compile project(':react-native-svg')
compile project(':react-native-maps')
compile project(':react-native-image-crop-picker')
compile project(':react-native-fs')
compile project(':react-native-fcm')
compile project(':react-native-audio-toolkit')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:25.0.0"
compile "com.facebook.react:react-native:+" // From node_modules
}
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
into 'libs'
}
apply plugin: 'com.google.gms.google-services'
android/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
url "https://jitpack.io"
}
maven {
url "https://maven.google.com"
}
}
}
设置.gradle
rootProject.name = 'ecoway'
include ':tipsi-stripe'
project(':tipsi-stripe').projectDir = new File(rootProject.projectDir, '../node_modules/tipsi-stripe/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-svg'
project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android')
include ':react-native-maps'
project(':react-native-maps').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-maps/lib/android')
include ':react-native-image-crop-picker'
project(':react-native-image-crop-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-crop-picker/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':react-native-fcm'
project(':react-native-fcm').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fcm/android')
include ':react-native-audio-toolkit'
project(':react-native-audio-toolkit').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-audio-toolkit/android/lib')
include ':app'
最佳答案
我也遇到了同样的问题,我尝试从 25 升级到 26 Android 版本( https://github.com/facebook/react-native/issues/18095 ),但我无法做到这一点,因为它的 React Native 还不支持 26,然后我降级到 25,发现了同样的问题,
这对我有用......
build.gradle 文件
android {
compileSdkVersion 25
buildToolsVersion '26.0.1'
defaultConfig {
minSdkVersion 18
targetSdkVersion 25
compile 'com.android.support:appcompat-v7:25.0.0'
AndroidManifest.xml
<uses-sdk android:minSdkVersion="18"
android:targetSdkVersion="25" />
React-native版本0.47.2
关于javascript - AAPT : No resource found that matches the given name: attr 'android:keyboardNavigationCluster' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48073394/
调试了3天还是没解决。如果你们中有人知道问题的根源以及我如何解决它,那我会很高兴?请原谅我不知道有更好的方法来粘贴错误消息。 错误日志: Cause 1: java.util.concurrent.E
最近,我将我的 android-SDK 升级到了 Android M(API 22,MNC 预览版)。之后,每个项目打开Eclipse都报错。 错误说:“执行 aapt 时出错。请检查 aapt 是否
我在 Visual Studio 2017 中有一个 cordova 应用程序项目,到目前为止一直在构建良好。没有对项目进行任何更改。 现在我们遇到了这个构建错误: 1>MSBUILD : cordo
每当我尝试在一些更改后第二次运行 android 项目时,我都会收到此错误。如果我关闭模拟器错误消失。但是每次都关闭模拟器不是一个可行的解决方案。我应该怎么做才能摆脱这个问题? Description
当我尝试构建和运行 Flutter 应用程序时,它向我显示以下消息: “无法找到 aapt。请确保您已安装 Android 构建工具。 异常(exception):构建 Android 应用程序时出现
我有一个奇怪的问题。在我的 bash 脚本或 Makefile 中,使用带有绝对路径的 aapt 不起作用,但如果我在本地目录中,它就起作用了。 如果我执行以下操作,它不起作用: aapt add $
aapt的输出格式是什么? 例如检查这里的输出 http://elinux.org/Android_aapt config 0 lang=-- cnt=-- orien=0 touch=0 densi
我已经尝试通过 Java 程序执行 aapt 命令已有一段时间了。我的预感是我应该使用 runtime.exec() 命令来实现这一点。但是,我查看了其他问题和答案,但似乎没有一个对我有用。命令是:
尝试使用 Maven 构建 Android 项目,我们无法使用它使用 google play services apklib 编译它。 我已经尝试从 apklib 中删除所有语言,只保留默认语言,它似
我想在带有 android sdk(文件夹/build-tools/24.0.1)的 Mac 上使用 aapt 命令。但是每当我尝试使用该命令时,我都会收到一条消息,提示找不到该命令 (aapt/aa
当我在 Windows 7 下列出正在运行的进程时,大约有 20 个 aapt.exe 进程正在显示,它们占用了大量内存。打开 android studio 时会发生这种情况。我总是被迫退出 andr
我的 Android 项目有一个 Ant 构建脚本。我正在使用 aapt 来打包各种资源文件。我想要解压缩资源文件。我试过“-0”标志,但文件仍然被压缩!但是当我通过 Eclipse 构建时,资源文件
我刚刚更新了 ADT,而不是 SDK,现在我只有一个项目存在这个问题,即我的 aapt 没有找到 Error executing aapt. Please check aapt is present
在使用eclipse进行安卓java的编程的时候,有时候我们会遇到这样的问题:那就是无故弹出aapt.exe停止工作的提示,虽然程序不会崩溃,但是这个提示经常弹出很是烦人。今天,小编就来教大家aap
我在使用 aapt 将资源打包到 apk 时遇到了一些麻烦。 .没有 @drawable/[...] 时一切正常或 @styles/[...]我的 AndroidManifest.xml 中的方向.但
我正在尝试将lib com.android.support:preference-v7:23.1.0导入到我的项目中。 但是,当我添加 compile ("com.android.support:pr
我尝试使用 android studio 构建一个 android 应用程序。当我尝试构建时,Gradle 抛出此错误: Gradle invocation completed successfull
我想以编程方式创建打包的资源文件(这就是问题),直接在 Android 手机上运行的应用程序中创建。有没有办法在手机上执行“aapt.exe”,或者有其他方法从java库创建resource._rsc
最近我一直在尝试构建一个 Android NDK 应用程序,该应用程序在过去编译和打包时没有问题。但是由于系统更新或 SDK 更新,有些东西发生了变化,现在当我尝试构建应用程序时,出现以下错误: /h
我有原始资源,偶尔会在构建之间交换或修改,但文件名不会更改,而 aapt 不会合并这些更改;它使用以前版本的 bin/MyThing.ap_(我猜这是他们被藏起来的地方)。来自 ant debug:
我是一名优秀的程序员,十分优秀!