Android ant build.xml with proguard not created in release

I have the following project setup: "General library components" and "libraries", which both have specific actions, for example. with web browsing and dialog classes. Then there is my โ€œapplication libraryโ€, which contains the application code, which, in turn, is referenced by the App 'Free' and the application 'Full'.

I included proguard with the following additional entry

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

However, the build process does not work when running ant for release and proguard complains that the R $ string classes are missing

If I call 'ant release' on 'commoncomponents', 'libs' or 'application library', then the proguard succeeds, but when I run it either in the "free application" or "in the application completely", this error appears:

  [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$1: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog$1: can't find referenced class com.example.common.R$string [proguard] Warning: com.example.common.WebDialog$1: 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. 

Setting up the project seems to me cumbersome, since "ant debug" compiles without errors. The package name has been changed to com.example and my user directory is up to ~ / xy in the listing above

I searched the Internet for a problem and I found many posts, especially here on stackoverflow, but no one helped me solve this problem, hope someone is so kind as to help, although this is my first question. Thanks

+4
source share
1 answer

It turned out that the obguuscation proguard function was enabled in the application library assembly file, disabling all the characters that were found when creating free and filled out application stubs.

+3
source

All Articles