我正在尝试使用 Proguard 来混淆我的代码。我将 Mobclix 用于广告,当我构建我的 APK 时,它吐出一个错误:
org.eclipse.core.runtime.CoreException: Proguard returned with error code 1. See console
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:228)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:290)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:229)
at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:214)
at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
Caused by: Proguard Error 1
Output:
Warning: com.mobclix.android.sdk.MobclixContactsCursorEntityIterator: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsCursorEntityIterator: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5$EntityIteratorImpl: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5$EntityIteratorImpl: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5$EntityIteratorImpl: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5$EntityIteratorImpl: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5$EntityIteratorImpl: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsEntityIterator: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity$NamedContentValues
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity$NamedContentValues
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity$NamedContentValues
Warning: com.mobclix.android.sdk.MobclixContactsSdk5: can't find referenced class android.content.Entity
You should check if you need to specify additional program jars.
Warning: there were 17 unresolved references to classes or interfaces.
You may need to specify additional library jars (using '-libraryjars'),
or perhaps the '-dontskipnonpubliclibraryclasses' option.
java.io.IOException: Please correct the above warnings first.
at proguard.Initializer.execute(Initializer.java:308)
at proguard.ProGuard.initialize(ProGuard.java:210)
at proguard.ProGuard.execute(ProGuard.java:85)
at proguard.ProGuard.main(ProGuard.java:499)
at com.android.ide.eclipse.adt.internal.build.BuildHelper.runProguard(BuildHelper.java:527)
at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:187)
... 4 more
现在,我已将 Mobclix 推荐的文档从他们的文档中放入我的 proguard.cfg 中:
-keep public class com.mobclix.android.sdk.*
-keep class com.mobclix.android.sdk.MobclixJavascriptInterface
-keepclassmembers class com.mobclix.android.sdk.MobclixJavascriptInterface
{
public void *(...);
<methods>;
}
-keepclassmembernames class
com.mobclix.android.sdk.MobclixJavascriptInterface {
public void *(...);
<methods>;
}
还有什么我应该做的吗?太感谢了