带有proguard的Android ant build.xml不会在发行版中构建

带有proguard的Android ant build.xml不会在发行版中构建,第1张

概述我有以下项目设置: 两个库的’commoncomponents’和’libs’都定义了一些活动,例如:使用webview和对话帮助程序类. 然后是我的“应用程序库”,其中包含应用程序代码 App’Free’和App’Full’引用. 我已通过以下附加条目启用了proguard -keepclassmembers class **.R$* { public static <fields>; 我有以下项目设置:
两个库的’commoncomponents’和’libs’都定义了一些活动,例如:使用webvIEw和对话帮助程序类.
然后是我的“应用程序库”,其中包含应用程序代码
App’Free’和App’Full’引用.

我已通过以下附加条目启用了proguard

-keepclassmembers class **.R$* {    public static <fIElds>;}

但是,在使用release target和proguard启动ant时,构建过程会失败
抱怨R $字符串类丢失了

如果我在’commoncomponents’,’libs’或’application library’项目proguard上调用’ant release’成功,
但是当我在’app free’或’app full’上启动它时会出现这个错误消息:

[echo] ----------     [echo] Creating output directorIEs if needed...    [mkdir] Created dir: ~/Workspace/Workspaces/workspace-indigo/MyApp/bin/classes     [echo] ----------     [echo] Resolving DependencIEs for bin...[dependency] library dependencIEs:[dependency] ------------------[dependency] Ordered librarIEs:[dependency] ------------------[dependency] API<=15: Adding annotations.jar to the classpath.-pre-build:-code-gen:[mergemanifest] No changes in the AndroIDManifest files.     [echo] Handling aIDl files...     [aIDl] Found 2 AIDL files.     [aIDl] No AIDL files to compile.     [echo] ----------     [echo] Handling RenderScript files...[renderscript] No RenderScript files to compile.     [echo] ----------     [echo] Handling Resources...     [aapt] No changed resources. R.java and Manifest.java untouched.     [echo] ----------     [echo] Handling BuildConfig class...[buildconfig] Build type changed: Generating new BuildConfig class.-pre-compile:-compile:    [javac] Compiling 12 source files to ~/Workspace/Workspaces/workspace-indigo/MyApp/bin/classes     [echo] Creating library output jar file...      [jar] Building jar: ~/Workspace/Workspaces/workspace-indigo/MyApp/bin/classes.jar-post-compile:-obfuscate:   [delete] Deleting: ~/Workspace/Workspaces/workspace-indigo/MyApp/bin/proguard/original.jar      [jar] Building jar: ~/Workspace/Workspaces/workspace-indigo/MyApp/bin/proguard/original.jar [proguard] ProGuard,version 4.7 [proguard] Reading input... [proguard] Reading program jar [~/Workspace/Workspaces/workspace-indigo/MyApp/bin/proguard/original.jar] [proguard] Reading program jar [~/Workspace/Workspaces/workspace-indigo/CommonComponents/bin/classes.jar] [proguard] Reading program jar [~/Workspace/Workspaces/workspace-indigo/examplelib/bin/classes.jar] [proguard] Reading program jar [~/Workspace/Workspaces/workspace-indigo/Bfw/bin/classes.jar] [proguard] Reading program jar [/Developer/Java/androID-sdk-macosx/tools/support/annotations.jar] [proguard] Reading program jar [~/Workspace/Workspaces/workspace-indigo/MyApp/libs/androID-support-v4.jar] [proguard] Reading library jar [/Developer/Java/androID-sdk-macosx/platforms/androID-10/androID.jar] [proguard] Reading library jar [/Developer/Java/androID-sdk-macosx/add-ons/addon-real3d-lge-10/libs/real3d.jar] [proguard] Initializing... [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R$string [proguard] Warning: com.example.ApplicationBase: can't find referenced class com.example.lib.R [proguard] Warning: com.example.common.HelpDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.HelpDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.HelpDialog: can't find referenced class com.example.common.R [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$layout [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$ID [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$layout [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$ID [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog: can't find referenced class com.example.common.R [proguard] Warning: com.example.dlg.InfoDialogActivity: can't find referenced class com.example.lib.R$layout [proguard] Warning: com.example.dlg.InfoDialogActivity: can't find referenced class com.example.lib.R$layout [proguard] Warning: com.example.dlg.InfoDialogActivity: can't find referenced class com.example.lib.R [proguard] Note: the configuration refers to the unkNown class 'com.Google.vending.licensing.IlicensingService' [proguard] Note: the configuration refers to the unkNown class 'com.androID.vending.licensing.IlicensingService' [proguard] Note: there were 2 references to unkNown classes. [proguard]       You should check your configuration for typos. [proguard] Warning: there were 23 unresolved references to classes or interfaces. [proguard]          You may need to specify additional library jars (using '-libraryjars').BUILD Failed/Developer/Java/androID-sdk-macosx/tools/ant/build.xml:570: The following error occurred while executing this line:/Developer/Java/androID-sdk-macosx/tools/ant/build.xml:834: Please correct the above warnings first.

项目设置对我来说似乎没问题,因为’ant deBUG’编译没有错误.
包名称已更改为com.example,我的用户目录更改为上面列表中的〜/ xy

我在网上搜索了这个问题,我在stackoverflow上找到了很多帖子,但是没有人帮助我解决这个问题,希望有人能帮助我,尽管这是我的第一个问题.
谢谢

解决方法 事实证明,应用程序库构建文件已打开proguard混淆,通过将其关闭,在构建免费和完整应用程序存根时找到所有符号. 总结

以上是内存溢出为你收集整理的带有proguard的Android ant build.xml不会在发行版中构建全部内容,希望文章能够帮你解决带有proguard的Android ant build.xml不会在发行版中构建所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1127256.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-30
下一篇 2022-05-30

发表评论

登录后才能评论

评论列表(0条)

保存