Android Studio Android构建错误:在build/Kotlin/sessions中检测到多个Kotlin守护进程会话

rqenqsqc  于 12个月前  发布在  Android
关注(0)|答案(2)|浏览(122)

我正在跟踪React Native 0.67.4instruction,以在构建发布包之前生成密钥和签名配置。该应用在Android模拟器(Android Studio 2120.1.1 Patch2)中运行良好。但是在构建发布包时,./gradlew assembleRelease./gradlew bundleRelease都有如下错误:
任务:app:signReleaseBundle FAQs

w: Detected multiple Kotlin daemon sessions at build/kotlin/sessions

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:signReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
   > java.lang.NullPointerException (no error message)

字符串
已在post:中尝试以下操作
1.在./gradle和yarn run android下搜索所有内容
1../gradlew清洁多次
Android Studio 2021.1.1 Patch2,Gradle React Native插件版本7.2.1/(gradle 7.4.1)
以下是package.json的一部分:

"dependencies": {
    "@ethersproject/shims": "^5.6.0",
    "@react-native-community/toolbar-android": "^0.2.1",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@react-native-picker/picker": "^2.4.0",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/stack": "^6.1.1",
    "crypto-js": "^4.1.1",
    "ethers": "^5.6.1",
    "react": "17.0.2",
    "react-native": "0.67.4",
    "react-native-blob-util": "^0.14.1",
    "react-native-confirmation-code-field": "^7.3.0",
    "react-native-device-info": "^8.5.1",
    "react-native-easy-grid": "^0.2.2",
    "react-native-elements": "^3.4.2",
    "react-native-encrypted-storage": "^4.0.2",
    "react-native-flash-message": "^0.2.1",
    "react-native-gesture-handler": "^2.3.2",
    "react-native-get-random-values": "^1.7.2",
    "react-native-gifted-chat": "^0.16.3",
    "react-native-image-picker": "^4.7.3",
    "react-native-loading-spinner-overlay": "^3.0.0",
    "react-native-modal": "^13.0.1",
    "react-native-reanimated": "^2.5.0",
    "react-native-redash": "^16.2.3",
    "react-native-responsive-screen": "^1.4.2",
    "react-native-safe-area-context": "^4.2.2",
    "react-native-screens": "^3.13.1",
    "react-native-vector-icons": "^9.1.0",
    "rn-alioss": "^0.2.5",
    "socket.io-client": "^4.4.1"
  },
  "devDependencies": {
    "@babel/core": "^7.12.9",
    "@babel/runtime": "^7.12.5",
    "@react-native-community/eslint-config": "^2.0.0",
    "babel-jest": "^26.6.3",
    "eslint": "7.14.0",
    "jest": "^26.6.3",
    "metro-react-native-babel-preset": "^0.66.2",
    "react-test-renderer": "17.0.2"
  },

snz8szmq

snz8szmq1#

我也在到处寻找解决同样问题的方法。最后,在花了几个小时之后,我终于找到了一个对我有效的解决方案,我想这也会解决你的问题。
如错误日志所示,我们确实有多个Kotlin守护进程会话在后台运行。
您可以自己检查。转到android文件夹并输入
./gradlew --status
它将显示所有正在运行的守护进程沿着进程id和它的状态。现在,我们只能停止它们。
./gradlew --stop
现在,使用terminal命令导航到home目录
cd ~
之后,删除隐藏的.gradle文件夹使用
sudo rm -rf .gradle
现在您已经删除了所有守护进程缓存,可以进行全新的安装了。
卸下node_modules并重新安装包
为了安全起见,导航到android文件夹并执行./gradlew clean
现在构建你的react-native项目!

gblwokeq

gblwokeq2#

对我有用:

cd android && ./gradlew :app:assembleRelease

字符串

相关问题