【问题标题】:socialauth-android: proguard errors when exporting apksocialauth-android:导出 apk 时出现 proguard 错误
【发布时间】:2013-06-11 21:35:26
【问题描述】:

使用 socialauth-android,当我尝试导出我的项目时,我收到以下警告:

    Warning: org.brickred.socialauth.util.SocialAuthUtil: can't find referenced class javax.servlet.http.HttpServletRequest
     Warning: there were 111 unresolved references to classes or interfaces.
              You may need to add missing library jars or update their versions.
              If your code works fine without the missing classes, you can suppress
              the warnings with '-dontwarn' options.
     Warning: there were 140 unresolved references to program class members.
              Your input classes appear to be inconsistent.
              You may need to recompile the code or update the library versions.
              Alternatively, you may have to specify the option 
              '-dontskipnonpubliclibraryclassmembers'.
     java.io.IOException: Please correct the above warnings first.
        at proguard.Initializer.execute(Initializer.java:330)
        at proguard.ProGuard.initialize(ProGuard.java:212)
        at proguard.ProGuard.execute(ProGuard.java:87)
        at proguard.ProGuard.main(ProGuard.java:484)

有人可以帮忙吗?

【问题讨论】:

    标签: android proguard socialauth


    【解决方案1】:

    使用这个 proguard cfg 问题解决了:

    -keep class org.brickred.** { *; } -dontwarn org.brickred.**
    

    【讨论】:

    • 太棒了!!你让我开心!!
    • 嗨,我是 proguard 的新手。我需要保留这条线
    【解决方案2】:

    您的库中是否直接有这些罐子?或者你让他们通过maven?你运行的是哪个 sdk 版本?

    如果您在编译时添加 jar,它可能不会包含在 proguard 处理中。运行预构建目标后,jar 必须就位。

    【讨论】:

    • 我将 jars 直接放在库中。我正在使用最新的 sdk v2.5
    • 我的意思是你用的是哪个 android sdk,最新版本是 r22。 r16+ 中发生了一些重大变化。您的项目是一个应用程序吗?或者是应用程序 -> 库项目 -> 外部库?
    • 我正在使用最新的 Android SDK 构建,并且我有外部库 social-auth 和 socialauth-android jars
    • 如果您直接包含 jar 而不是通过 maven,请确保您拥有所有依赖库。见grepcode.com/snapshot/repo1.maven.org/maven2/org.brickred/…
    • 我不熟悉 Maven,并试图包含其他依赖库。它导致了其他请求的依赖项!我不明白的是为什么在调试模式下(在连接 USB 的情况下启动)它确实可以工作并且在不使用 Proguard 的情况下导出为 APK 也可以在没有这些依赖项的情况下工作!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-07-14
    • 2023-03-04
    • 1970-01-01
    • 2019-02-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多