我在构建android项目时遇到以下错误:
AAPT: <project directory>appbuildintermediatesstable_resource_ids_filedebugstableIds.txt: error: failed to open: The data is invalid. (13).
它是在将项目的app
目录中的build.gradle
文件从com.android.tools.build:gradle:4.1.3
更新为com.android.tools.build:gradle:4.2.1
:之后开始发生的
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
...
dependencies {
...
classpath "com.android.tools.build:gradle:4.2.1"
...
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
目前,我正在通过将项目app
目录中build.gradle
文件中的com.android.tools.build:gradle:4.2.1
降级为com.android.tools.build:gradle:4.1.3
来避免这个问题:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
...
dependencies {
...
classpath "com.android.tools.build:gradle:4.1.3" // <--- downgrade to 4.1.3 to avoid build error!!
...
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
我遇到了同样的问题,我用解决了这个问题
rm -rf node_modules
yarn install