簡體   English   中英

運行 npm react-native run-android 時突然出錯。 任務:應用程序:進程調試資源失敗

[英]Sudden error while running the npm react-native run-android. Task :app:processDebugResources FAILED

我突然收到一條錯誤消息,說任務':app:processDebugResources'的執行失敗。 從 C:\Users\prabh\AppData\Local\Temp\gradle13962421950392783403.bin 偏移 114265 中的二進制存儲讀取數據時出現問題? 是的,我認為這個錯誤與反應原生 firebase 有關。 我正在使用 react-native-firebase/app、firebase/auth、firebase/messaging 包。 我很長一段時間都在使用這些軟件包,但以前從未遇到過問題。 我在收到此錯誤前幾個小時所做的唯一一件事是 npm 審計修復以修復一些漏洞。 有人遇到類似的錯誤嗎?

build.gradle 依賴:

    implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+"  // From node_modules
implementation 'com.google.firebase:firebase-analytics:17.3.0' //For Notifications
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
implementation project(':react-native-vector-icons')
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' // <-- add this; newer versions should work too
implementation project(':react-native-fs') //addes Manually compile project
implementation project(':react-native-get-real-path')
implementation 'com.facebook.fresco:fresco:2.0.0'
// For animated GIF support
implementation 'com.facebook.fresco:animated-gif:2.0.0'
// For WebP support, including animated WebP
implementation 'com.facebook.fresco:animated-webp:2.0.0'
implementation 'com.facebook.fresco:webpsupport:2.0.0'

這適用於我在 Windows 10 和 Android 上。 我沒有在 Mac 或 Linux 上嘗試。 我從https://github.com/gradle/gradle/issues/8489 @jack7891 看到了,謝謝傑克。 android/build.gradle classpath 'com.google.gms:google-services:4.3.4'到類路徑'com.google.gms:google-services:4.3.5'

android/app/build.gradle implementation 'com.google.firebase:firebase-analytics:17.3.0'implementation 'com.google.firebase:firebase-analytics:18.0.2'

package.json

 "@react-native-firebase/app": "^11.1.2",
 "@react-native-firebase/auth": "^11.1.2",
 "@react-native-firebase/firestore": "^11.1.2",
 "@react-native-firebase/storage": "^11.1.2",
 "@react-native-firebase/messaging": "^11.1.2",
 "react-native-push-notification": "^7.2.3",

 "@react-native-firebase/app": "^11.5.0",
 "@react-native-firebase/auth": "^11.5.0",
 "@react-native-firebase/firestore": "^11.5.0",
 "@react-native-firebase/storage": "^11.5.0",
 "@react-native-firebase/messaging": "^11.5.0",
 "react-native-push-notification": "^7.3.1",

然后運行npm installyarn install

之后,將 go 到 android 項目文件夾並運行:

./gradlew.bat clean

最后,您可以 go 到項目文件夾並運行npx react-native run-android

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM