AAPT:錯誤:資源 android:未找到 attr/IStar。
這個錯誤突然發生,上周作業正常。

我嘗試了很多解決方案,但沒有一個有效。嘗試的解決方案:
- 洗掉,重新安裝npm,使用
npm install ./gradlew clean在 /android 中清理 gradle- 清理 npm 快取
npm cache clean --force - 添加
org.gradle.jvmargs=-Xmx4608m/android/gradle.properties - 在 /android/build.gradle 里面
ext{}添加androidXCore = "1.6.0" npm update @react-native-community/netinfo- androidx.core:core-ktx: 到 androidx.core:core-ktx:1.6.0 但我搜索了我的專案,沒有'androidx.core:core-ktx: 。所以我發現的這個解決方案是無關緊要的。
版本:
"react-native": "0.63.4",
compileSdkVersion = 29
targetSdkVersion = 29
uj5u.com熱心網友回復:
將此添加到您的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
uj5u.com熱心網友回復:
從 2022 年 11 月 4 日開始,React Native 和 Expo 用戶在構建 Android 應用程式時遇到了一系列構建失敗。您的問題是一樣的。
由于您使用的是React-native 0.63React-native,因此為它發布了一個新補丁。package.json嘗試在from "react-native": "^0.63.4"to中更新您的 react-native"react-native": "^0.63.5"并嘗試運行npm install,一切都會正常作業。
如果您嘗試升級到新版本的 react-native 并忘記將其從 build.gradle 中洗掉,Thanhal 建議的答案會讓您有些頭疼。
有關更多資訊,請參閱github 上的此問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/528158.html
標籤:节点.js反应式npm
上一篇:表驅動法在STM32中的應用
