ProGuard,并将HoloEverywhere:出口签名的应用程序错误 [英] ProGuard and HoloEverywhere: Export Signed Application Errors

查看:367
本文介绍了ProGuard,并将HoloEverywhere:出口签名的应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用ActionBarSherlock和HoloEverywhere。一切都完美的作品,除了当我尝试导出我的签名的应用程序,ProGuard的带给我的悲伤:

I'm using ActionBarSherlock and HoloEverywhere in my project. Everything works perfectly, except when I try to export my signed application, ProGuard gives me grief:

[2013-05-19 00:13:53 - ] Proguard returned with error code 1. See console
[2013-05-19 00:13:53 - ] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced field 'android.content.Context mContext' in class com.actionbarsherlock.widget.SuggestionsAdapter
[2013-05-19 00:13:53 - ] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced method 'android.database.Cursor getCursor()' in class com.actionbarsherlock.widget.SuggestionsAdapter
[2013-05-19 00:13:53 - ] Warning: com.actionbarsherlock.widget.SuggestionsAdapter: can't find referenced field 'android.database.Cursor mCursor' in class com.actionbarsherlock.widget.SuggestionsAdapter
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ChooserActivity: can't find referenced method 'android.content.Intent getIntent()' in class org.holoeverywhere.ChooserActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ChooserActivity: can't find referenced method 'void finish()' in class org.holoeverywhere.ChooserActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ChooserActivity: can't find referenced method 'android.content.res.Resources getResources()' in class org.holoeverywhere.ChooserActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ThemeManager: can't find referenced method 'android.content.Intent getIntent()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ThemeManager: can't find referenced method 'boolean isRestricted()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ThemeManager: can't find referenced method 'boolean isFinishing()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ThemeManager: can't find referenced method 'void finish()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.ThemeManager: can't find referenced method 'void overridePendingTransition(int,int)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Activity: can't find referenced method 'android.content.Intent getIntent()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Activity: can't find referenced method 'android.content.res.Resources getResources()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Activity: can't find referenced method 'android.view.Window getWindow()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Activity: can't find referenced method 'java.lang.ClassLoader getClassLoader()' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Activity$24: can't find referenced method 'boolean requestWindowFeature(int)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.AlertActivity: can't find referenced method 'void finish()' in class org.holoeverywhere.app.AlertActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.AlertActivity: can't find referenced method 'boolean isFinishing()' in class org.holoeverywhere.app.AlertActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.AlertActivity: can't find referenced method 'android.view.Window getWindow()' in class org.holoeverywhere.app.AlertActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.AlertActivity: can't find referenced method 'boolean onKeyDown(int,android.view.KeyEvent)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.AlertActivity: can't find referenced method 'boolean onKeyUp(int,android.view.KeyEvent)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'android.support.v4.app.FragmentManager getFragmentManager()' in class org.holoeverywhere.app.DialogFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class org.holoeverywhere.app.DialogFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'void onActivityCreated(android.os.Bundle)' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'android.view.View getView()' in class org.holoeverywhere.app.DialogFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'void onDetach()' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'void onSaveInstanceState(android.os.Bundle)' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'void onStart()' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'void onStop()' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.DialogFragment: can't find referenced method 'java.lang.CharSequence getText(int)' in class org.holoeverywhere.app.DialogFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ExpandableListActivity: can't find referenced method 'void onRestoreInstanceState(android.os.Bundle)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.Fragment: can't find referenced method 'void setArguments(android.os.Bundle)' in class org.holoeverywhere.app.Fragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.GridFragment: can't find referenced method 'android.view.View getView()' in class org.holoeverywhere.app.GridFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.GridFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class org.holoeverywhere.app.GridFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ListActivity: can't find referenced method 'void onRestoreInstanceState(android.os.Bundle)' in class org.holoeverywhere.app.Activity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ListFragment: can't find referenced method 'android.view.View getView()' in class org.holoeverywhere.app.ListFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ListFragment: can't find referenced method 'android.support.v4.app.FragmentActivity getActivity()' in class org.holoeverywhere.app.ListFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'android.content.res.Resources getResources()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'android.content.Intent getIntent()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'android.content.pm.PackageManager getPackageManager()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'java.lang.String getPackageName()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'void finish()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'void onRestoreInstanceState(android.os.Bundle)' in class org.holoeverywhere.app.AlertActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity: can't find referenced method 'boolean isChangingConfigurations()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity$ResolveListAdapter: can't find referenced method 'void finish()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.ResolverActivity$ResolveListAdapter: can't find referenced method 'android.content.pm.PackageManager getPackageManager()' in class org.holoeverywhere.app.ResolverActivity
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.TabSwipeActivity: can't find referenced method 'boolean isDetached()' in class org.holoeverywhere.app.TabSwipeActivity$InnerFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.TabSwipeFragment: can't find referenced method 'java.lang.CharSequence getText(int)' in class org.holoeverywhere.app.TabSwipeFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.TabSwipeFragment: can't find referenced method 'void notifyDataSetChanged()' in class org.holoeverywhere.app.TabSwipeFragment$TabSwipeAdapter
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.app.TabSwipeFragment$TabSwipeAdapter: can't find referenced method 'android.support.v4.app.FragmentManager getChildFragmentManager()' in class org.holoeverywhere.app.TabSwipeFragment
[2013-05-19 00:13:53 - ] Warning: org.holoeverywhere.internal.AlertController$AlertParams$2: can't find referenced method 'android.database.Cursor getCursor()' in class org.holoeverywhere.internal.AlertController$AlertParams$2
[2013-05-19 00:13:53 - ]       You should check if you need to specify additional program jars.
[2013-05-19 00:13:53 - ] Warning: there were 51 unresolved references to program class members.
[2013-05-19 00:13:53 - ]          Your input classes appear to be inconsistent.
[2013-05-19 00:13:53 - ]          You may need to recompile them and try again.
[2013-05-19 00:13:53 - ]          Alternatively, you may have to specify the option 
[2013-05-19 00:13:53 - ]          '-dontskipnonpubliclibraryclassmembers'.
[2013-05-19 00:13:53 - ] java.io.IOException: Please correct the above warnings first.
[2013-05-19 00:13:53 - ]    at proguard.Initializer.execute(Initializer.java:321)
[2013-05-19 00:13:53 - ]    at proguard.ProGuard.initialize(ProGuard.java:211)
[2013-05-19 00:13:53 - ]    at proguard.ProGuard.execute(ProGuard.java:86)
[2013-05-19 00:13:53 - ]    at proguard.ProGuard.main(ProGuard.java:492)

我想包括我的ProGuard-project.txt以下行,但它似乎并没有做任何事情:

I tried including the following lines in my proguard-project.txt, but it didn't seem to do anything:

-keep class com.actionbarsherlock.** {*;}
-keep class org.holoeverywhere.** {*;}

这是我的project.properties:

This is my project.properties:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
proguard.config=${sdk.dir}\\tools\\proguard\\proguard-android.txt:proguard-project.txt

# Project target.
target=android-17
android.library.reference.1=../../../Downloads/JakeWharton-ActionBarSherlock-4.3.1-0-gc0d437c/JakeWharton-ActionBarSherlock-071a61c/actionbarsherlock
android.library.reference.2=../../../Downloads/HoloEverywhere-master (1)/HoloEverywhere-master/library

这是我的ProGuard-project.txt

This is my proguard-project.txt

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
#   http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
#   public *;
#}
-keep class com.actionbarsherlock.** 
-keep class org.holoeverywhere.**

任何人都知道如何解决这个问题?

Anyone know how to fix this?

推荐答案

我需要添加以下两行:

-libraryjars adt-bundle-windows-x86_64/sdk/platforms/android-17/android.jar
-libraryjars adt-bundle-windows-x86_64/sdk/extras/android/support/v4/android-support-v4.jar

这篇关于ProGuard,并将HoloEverywhere:出口签名的应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆