为什么我打开混淆器后无法从 Eclipse 中导出 apk 文件?
Why can't I export the apk file from Eclipse when I turn on ProGuard?
[2015-03-13 02:48:07 - ScoresOnGo] Proguard returned with error code 1. See console
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.fitness.service.FitnessSensorService$a: can't find referenced class android.app.AppOpsManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.fitness.service.FitnessSensorService$a: can't find referenced class android.app.AppOpsManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.af: can't find referenced method 'boolean isAttachedToWindow()' in class android.view.View
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.an: can't find referenced method 'void evaluateJavascript(java.lang.String,android.webkit.ValueCallback)' in class android.webkit.WebView
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.gu: can't find referenced method 'void evaluateJavascript(java.lang.String,android.webkit.ValueCallback)' in class android.webkit.WebView
[2015-03-13 02:48:07 - ScoresOnGo] You should check if you need to specify additional program jars.
[2015-03-13 02:48:07 - ScoresOnGo] Warning: there were 11 unresolved references to classes or interfaces.
[2015-03-13 02:48:07 - ScoresOnGo] You may need to specify additional library jars (using '-libraryjars').
[2015-03-13 02:48:07 - ScoresOnGo] Warning: there were 3 unresolved references to program class members.
[2015-03-13 02:48:07 - ScoresOnGo] Your input classes appear to be inconsistent.
[2015-03-13 02:48:07 - ScoresOnGo] You may need to recompile them and try again.
[2015-03-13 02:48:07 - ScoresOnGo] Alternatively, you may have to specify the option
[2015-03-13 02:48:07 - ScoresOnGo] '-dontskipnonpubliclibraryclassmembers'.
[2015-03-13 02:48:07 - ScoresOnGo] java.io.IOException: Please correct the above warnings first.
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.Initializer.execute(Initializer.java:321)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.initialize(ProGuard.java:211)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.execute(ProGuard.java:86)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.main(ProGuard.java:492)
我从来没有成功地从 Eclipse 中导出 apk 并打开了混淆器。由于 proguard 仅保护代码,而不保护资产,因此我禁用了它并将我的算法固定在 C++ 中。当我收到崩溃报告时,这个复杂的堆栈跟踪。
出于这些原因,我更喜欢 Java。我强烈建议在 Android Studio 中编写和迁移所有 Java 项目。毫不费力地打开proguard。但正如我所说,它 帮助 保护的只是你的算法,与 C++ 或 NDK 相比,大部分算法提升都是由 Java 框架完成的.
无法使用 proguard 导出的可能原因是导入的模块无法正常工作且不值得修复才能正常工作。如果您不导入 3rd 方模块,那么您需要指示混淆器不要混淆 类 它无法找到的其他方式。我开发的比我发布的多,所以我建议您参考手册以了解确切的语法。只是分享我的经验。
默认情况下,为了构建项目,proguard 不需要警告。
如果您没有使用引用的 类,您可以在混淆规则文件中使用 -dontwarn <classname>
标志。
如果您只是想碰碰运气,您也可以使用 -ignorewarnings
标志忽略所有警告并继续构建。
参见:
http://proguard.sourceforge.net/manual/troubleshooting.html
[2015-03-13 02:48:07 - ScoresOnGo] Proguard returned with error code 1. See console
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.cast.TextTrackStyle: can't find referenced class android.view.accessibility.CaptioningManager$CaptionStyle
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.fitness.service.FitnessSensorService$a: can't find referenced class android.app.AppOpsManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.fitness.service.FitnessSensorService$a: can't find referenced class android.app.AppOpsManager
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.af: can't find referenced method 'boolean isAttachedToWindow()' in class android.view.View
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.an: can't find referenced method 'void evaluateJavascript(java.lang.String,android.webkit.ValueCallback)' in class android.webkit.WebView
[2015-03-13 02:48:07 - ScoresOnGo] Warning: com.google.android.gms.internal.gu: can't find referenced method 'void evaluateJavascript(java.lang.String,android.webkit.ValueCallback)' in class android.webkit.WebView
[2015-03-13 02:48:07 - ScoresOnGo] You should check if you need to specify additional program jars.
[2015-03-13 02:48:07 - ScoresOnGo] Warning: there were 11 unresolved references to classes or interfaces.
[2015-03-13 02:48:07 - ScoresOnGo] You may need to specify additional library jars (using '-libraryjars').
[2015-03-13 02:48:07 - ScoresOnGo] Warning: there were 3 unresolved references to program class members.
[2015-03-13 02:48:07 - ScoresOnGo] Your input classes appear to be inconsistent.
[2015-03-13 02:48:07 - ScoresOnGo] You may need to recompile them and try again.
[2015-03-13 02:48:07 - ScoresOnGo] Alternatively, you may have to specify the option
[2015-03-13 02:48:07 - ScoresOnGo] '-dontskipnonpubliclibraryclassmembers'.
[2015-03-13 02:48:07 - ScoresOnGo] java.io.IOException: Please correct the above warnings first.
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.Initializer.execute(Initializer.java:321)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.initialize(ProGuard.java:211)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.execute(ProGuard.java:86)
[2015-03-13 02:48:07 - ScoresOnGo] at proguard.ProGuard.main(ProGuard.java:492)
我从来没有成功地从 Eclipse 中导出 apk 并打开了混淆器。由于 proguard 仅保护代码,而不保护资产,因此我禁用了它并将我的算法固定在 C++ 中。当我收到崩溃报告时,这个复杂的堆栈跟踪。
出于这些原因,我更喜欢 Java。我强烈建议在 Android Studio 中编写和迁移所有 Java 项目。毫不费力地打开proguard。但正如我所说,它 帮助 保护的只是你的算法,与 C++ 或 NDK 相比,大部分算法提升都是由 Java 框架完成的.
无法使用 proguard 导出的可能原因是导入的模块无法正常工作且不值得修复才能正常工作。如果您不导入 3rd 方模块,那么您需要指示混淆器不要混淆 类 它无法找到的其他方式。我开发的比我发布的多,所以我建议您参考手册以了解确切的语法。只是分享我的经验。
默认情况下,为了构建项目,proguard 不需要警告。
如果您没有使用引用的 类,您可以在混淆规则文件中使用 -dontwarn <classname>
标志。
如果您只是想碰碰运气,您也可以使用 -ignorewarnings
标志忽略所有警告并继续构建。
参见: http://proguard.sourceforge.net/manual/troubleshooting.html