[英]error while relaese android react native apk
我在發布 apk 構建中有各種問題。 目前我通過重命名所有庫包以及因此給我帶來問題的所有導入來解決它。 但我需要一個想法,不要每次都這樣做。 你有什么解決辦法嗎?
如果我不重命名庫,則錯誤是:
C:\Users\manue\OneDrive\Desktop\MyApp\node_modules\react-native-device-info\android\build.transforms\9166b1d6d34e6b3b03f3d84907b6a605\transformed\classes\classes.dex, C:\Users\manue\OneDrive\Desktop\MyApp\android\app\build\intermediates\external_libs_dex\release\mergeExtDexRelease\classes2.dex
其他 7 個庫也給了我這些錯誤:
react-native-async-storage-async react-native-sound react-native-background-timer react-native-device-info react-native-splash-screen react-native-google-signin react-native-community-netinfo
將以下代碼添加到 build.gradle app 模塊解決了我的問題
android{
defaultConfig {
// Enabling multidex support.
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
}
dependencies {
//...
compile 'com.android.support:multidex:1.0.0'
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.