• Unity导出APk出错解决方法二


    错误提示(需得打开编辑器log文件才能看到全部log,Unity3d只显示一部分):

    Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
    C:/Program Files/Java/jdk1.8.0_05injava.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="F:adt-bundle-windows-x86_64sdk	ools" -Dfile.encoding=UTF8 -jar "D:developUnity5.3.7EditorDataPlaybackEnginesAndroidPlayer/Toolssdktools.jar" -
    
    warning: Ignoring InnerClasses attribute for an anonymous inner class
    (com.tendcloud.tenddata.game.ae) that doesn't come with an
    associated EnclosingMethod attribute. This class was probably produced by a
    compiler that did not target the modern .class file format. The recommended
    solution is to recompile the class from source, using an up-to-date compiler
    and without specifying any "-target" type options. The consequence of ignoring
    this warning is that reflective operations on this class will incorrectly
    indicate that it is *not* an inner class.
    
    rouble writing output: Too many method references to fit in one dex file: 67088; max is 65536.
    You may try using multi-dex. If multi-dex is enabled then the list of classes for the main dex list is too large.
    References by package:
         4 android.accessibilityservice
         4 android.accounts
       106 android.animation
       451 android.app
        17 android.app.job
         2 android.appwidget
        53 android.arch.core.internal
       105 android.arch.lifecycle
         1 android.bluetooth
       241 android.content
        55 android.content.pm
       111 android.content.res
        58 android.database
        25 android.database.sqlite
       256 android.graphics
       130 android.graphics.drawable
         3 android.graphics.drawable.shapes
         3 android.graphics.pdf
        35 android.hardware
         5 android.hardware.display
        11 android.hardware.fingerprint
        24 android.location
       259 android.media
        19 android.media.browse
        92 android.media.session
        69 android.net
         6 android.net.http
         7 android.net.nsd
        16 android.net.wifi
         2 android.nfc
         2 android.nfc.cardemulation
        71 android.opengl
       311 android.os
         1 android.preference
        28 android.print
         5 android.print.pdf
        18 android.provider
         8 android.renderscript
         9 android.security
         6 android.security.keystore
        10 android.service.media
        31 android.support.annotation
        14 android.support.compat
       153 android.support.constraint
       125 android.support.constraint.solver
       375 android.support.constraint.solver.widgets
        14 android.support.coreui
        14 android.support.coreutils
       216 android.support.customtabs
        16 android.support.design
       309 android.support.design.internal
      1527 android.support.design.widget
        14 android.support.fragment
       335 android.support.graphics.drawable
        14 android.support.graphics.drawable.animated
        14 android.support.mediacompat
       843 android.support.transition

    解决方法:

    1.去掉不需要的jar包

    2.导出android studio工程使用多个multi-dex:true 选项

    官方文档解决64k限制方法:https://developer.android.com/studio/build/multidex

    相关文章 https://medium.com/@abhpatidar/solving-unity-dex-issue-538e134c8809

  • 相关阅读:
    HLS视频直播
    CocoaPods版本升级
    项目管理:CocoaPods建立私有仓库
    cocospod 安装和使用
    sqlite加密
    socket的心跳包机制
    iOS开发必备HUD(透明指示层)
    iOS 第一次安装应用,拒绝相机调用,页面卡死的解决方案
    UINavigationController侧滑滑动返回 卡死问题
    第四周学习进度
  • 原文地址:https://www.cnblogs.com/mttnor/p/9961855.html
Copyright © 2020-2023  润新知