简体   繁体   English

relaese android反应本机apk时出错

[英]error while relaese android react native apk

I have various problems in relaese apk build.我在发布 apk 构建中有各种问题。 At the moment I solved it by renaming all the library packages and consequently all the imports that give me problems.目前我通过重命名所有库包以及因此给我带来问题的所有导入来解决它。 But I need an idea not to do this every time.但我需要一个想法,不要每次都这样做。 Do you have any solutions about it?你有什么解决办法吗?

The errors if I don't rename the libraries are:如果我不重命名库,则错误是:

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

other 7 libraries also give me these errors:其他 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 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

Adding the following code to build.gradle app module solved my problem将以下代码添加到 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM