2013-05-10 4 views
8

Meine App läuft normal, wenn ProGuard deaktiviert ist.ProGuard mit Android: java.lang.NoSuchMethodError: android.util.Xml.asAttributeSet

Nachdem ProGuard aktiviert wurde, wird die App in Apk exportiert und im Emulator installiert. Dann

, wenn ich es in Emulator laufen, in der Nähe zwingen ...

05-10 11:14:10.582: E/AndroidRuntime(759): FATAL EXCEPTION: main 
05-10 11:14:10.582: E/AndroidRuntime(759): java.lang.NoSuchMethodError: android.util.Xml.asAttributeSet 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.view.MenuInflater.inflate(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.g.myapp.e.onCreateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.Watson.onCreatePanelMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.ActionBarSherlock.callbackCreateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchCreateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.app.SherlockFragmentActivity.onCreatePanelMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.android.internal.policy.impl.PhoneWindow.preparePanel(PhoneWindow.java:393) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.android.internal.policy.impl.PhoneWindow.invalidatePanelMenu(PhoneWindow.java:747) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.internal.ActionBarSherlockNative.dispatchInvalidateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.app.SherlockFragmentActivity.invalidateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.actionbarsherlock.app.SherlockFragmentActivity.supportInvalidateOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.Fragment.setHasOptionsMenu(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.g.myapp.e.onCreate(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.FragmentManagerImpl.moveToState(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.BackStackRecord.run(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.FragmentManagerImpl.execPendingActions(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.support.v4.app.FragmentManagerImpl.executePendingTransactions(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.g.myapp.n.onTabChanged(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.widget.TabHost.invokeOnTabChangeListener(TabHost.java:391) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.widget.TabHost.setCurrentTab(TabHost.java:376) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.widget.TabHost.addTab(TabHost.java:236) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.g.myapp.n.a(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.g.myapp.MainActivity.onCreate(Unknown Source) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.Activity.performCreate(Activity.java:5008) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.ActivityThread.access$600(ActivityThread.java:130) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.os.Handler.dispatchMessage(Handler.java:99) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.os.Looper.loop(Looper.java:137) 
05-10 11:14:10.582: E/AndroidRuntime(759): at android.app.ActivityThread.main(ActivityThread.java:4745) 
05-10 11:14:10.582: E/AndroidRuntime(759): at java.lang.reflect.Method.invokeNative(Native Method) 
05-10 11:14:10.582: E/AndroidRuntime(759): at java.lang.reflect.Method.invoke(Method.java:511) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786) 
05-10 11:14:10.582: E/AndroidRuntime(759): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
05-10 11:14:10.582: E/AndroidRuntime(759): at dalvik.system.NativeStart.main(Native Method) 

proguard-project.txt:

-keep class android.support.v4.app.** { *; } 
-keep interface android.support.v4.app.** { *; } 
-keep class com.actionbarsherlock.** { *; } 
-keep interface com.actionbarsherlock.** { *; } 

-keepattributes *Annotation* 

-dontwarn org.w3c.dom.bootstrap.** 
-dontwarn org.joda.time.** 
-dontwarn org.xmlpull.v1.** 

Wie kann ich den Fehler beheben?

Vielen Dank!


Aktualisiert:

Die App kann nach dem Hinzufügen einer Zeile ProGuard-project.txt in Emulator ausgeführt werden:

-keep class * { *; } 

Obwohl die App ausgeführt werden kann, denke ich, diese Lösung kann sei nicht so gut ...

Jede bessere Lösung?

Bitte helfen.

Vielen Dank.

Antwort

29

fügen eine Zeile ProGuard-project.txt:

-keep class org.xmlpull.v1.** { *; } 
+0

Thank you very very much. Habe mit Proguard gekämpft und falsche Ausnahmen gegeben. – IgorOliveira

+0

Es ist Arbeit für mich.ty –