AAPT: error: resource android: attr/IStar not found.

这个错误发生得很突然,上周它还运行得很好.

enter image description here

我试过很多办法,但都不管用.try 的解决方案:

  1. 删除、重新安装NPM,使用npm install
  2. Clean Gradle,./gradlew clean英寸/安卓
  3. 使用npm cache clean --force清理NPM缓存
  4. 在/android/gradle.properties中添加org.gradle.jvmargs=-Xmx4608m
  5. 在/安卓/build.gradle,ext{}内加androidXCore = "1.6.0"
  6. npm update @react-native-community/netinfo
  7. Core:core-ktx:+to androidx.core:core-ktx:1.6.0但是我已经搜索了我的项目,没有‘androidx.core:core-ktx:+.所以我找到的这个解决方案无关紧要.

Version:

"react-native": "0.63.4",

compileSdkVersion = 29
targetSdkVersion = 29

推荐答案

将此添加到您的android/buld.gradle文件中.

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {
    configurations.all {
        resolutionStrategy {
            // Remove this override in 0.65+, as a proper fix is included in react-native itself.
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }

参考文献:https://github.com/facebook/react-native/issues/35210

Node.js相关问答推荐

Node.js promise 循环中的所有多个API调用

对接Nestjs/VueJS应用程序

在我的Next.js应用程序中没有正确设置Process.env.NODE_ENV

如何在MongoDB中更新嵌套数组

NPM:无法导入本码模块

请求正文未定义

如何在Sequelize with Postgres中将m:n关联表ID从整数迁移到UUID?

通过 Node js 中的 TBA 执行 netsuite REST upsert 操作出现 401 错误

PM2 是否需要成为其托管项目的依赖项?

我如何在nodejs中的路由之间交换令牌

表达 js 错误处理程序在第一个之后被忽略

数据未被中间件解析

我如何在 Raku 的供应中注册不同的事件?

try 在 NodeJS 项目中实现 SimplePay (OTP) 支付网关,但我无法获得与技术文档中相同的签名

nuxt:在 docker 镜像中找不到

discordjs如何添加所有意图/权限

带权限的机密 Rest-Api - 总是 403 - 我做错了什么?

如何在 Mongoose 模式中设置数组大小限制

Node.js + Express:应用程序不会开始监听端口 80

Node.js 与 .net 中的异步/等待