RE: Android + Restlet + Proguard
Sorry but the problem is not this, there is not cat with empty name. Probably you miss one point in this post, the code work well without PROGUARD and crash with PROGUARD. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971731
RE: Android + Restlet + Proguard
I have to apologize with you, I am very sorry but I sent in the first message of this thread, a wrong stacktrace. the stacktrace is: 06-18 06:36:03.065: E/AndroidRuntime(5137): FATAL EXCEPTION: main 06-18 06:36:03.065: E/AndroidRuntime(5137): java.lang.NullPointerException 06-18 06:36:03.065: E/AndroidRuntime(5137): at com.voicepro.av.onPostExecute(SourceFile:329) 06-18 06:36:03.065: E/AndroidRuntime(5137): at com.voicepro.av.onPostExecute(SourceFile:1) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.os.AsyncTask.finish(AsyncTask.java:602) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.os.AsyncTask.access$600(AsyncTask.java:156) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:615) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.os.Handler.dispatchMessage(Handler.java:99) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.os.Looper.loop(Looper.java:137) 06-18 06:36:03.065: E/AndroidRuntime(5137): at android.app.ActivityThread.main(ActivityThread.java:4507) 06-18 06:36:03.065: E/AndroidRuntime(5137): at java.lang.reflect.Method.invokeNative(Native Method) 06-18 06:36:03.065: E/AndroidRuntime(5137): at java.lang.reflect.Method.invoke(Method.java:511) 06-18 06:36:03.065: E/AndroidRuntime(5137): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790) 06-18 06:36:03.065: E/AndroidRuntime(5137): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557) 06-18 06:36:03.065: E/AndroidRuntime(5137): at dalvik.system.NativeStart.main(Native Method) and the line 329 of av class is: for (NewsCatalog newsCatalog : result) { this is the line 329==> if (!newsCatalog.news1.startsWith("com:")) { tickers.append(newsCatalog.publishDate.toString()); tickers.append(" - "); tickers.append(newsCatalog.news1); tickers.append(" "); } else { String command = newsCatalog.news1.substring(4); Utils.ExecuteCommand(MainActivityNew.this, command); } } If I don't use PROGUARD all work fine, with PROGUARD enable crash. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971736
RE: Android + Restlet + Proguard
I solved the problem using -keep class org.restlet.** { *; } in proguard file. Thank you very much for support. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971791
RE: Android + Restlet + Proguard
Giuseppe, Looking at your code, this line is in cause: Log.v("Brano:", cat.getName()); Your category name is probably null. Just add a check. Best regards, Jerome -- http://www.restlet.com http://twitter.com/#!/jlouvel -Message d'origine- De : Giuseppe Porcelli [mailto:porcelli.giuse...@gmail.com] Envoyé : dimanche 17 juin 2012 14:26 À : discuss@restlet.tigris.org Objet : RE: Android + Restlet + Proguard ODataInteface -> com.voicepro.odata.u BraniList -> com.voicepro.odata.BraniList BraniList$5 -> com.voicepro.odata.m: Attached only two classes as the reference you looking for are all in this two classes. Thank you for help. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29716 75 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971686
RE: Android + Restlet + Proguard
Hi Giuseppe, Sorry, this went through... I can't delete messages with this mailing list hosted on Tigris. You better change your user name and/or password. Best regards, Jerome -- http://www.restlet.com http://twitter.com/#!/jlouvel -Message d'origine- De : Giuseppe Porcelli [mailto:porcelli.giuse...@gmail.com] Envoyé : dimanche 17 juin 2012 14:32 À : discuss@restlet.tigris.org Objet : RE: Android + Restlet + Proguard Jerome, I have published the two class with username and password of our server inside it, please remove ASAP the two attachment from this thread and also remove the present message. Thank you. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29716 77 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971685
RE: Android + Restlet + Proguard
Jerome, I have published the two class with username and password of our server inside it, please remove ASAP the two attachment from this thread and also remove the present message. Thank you. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971677
RE: Android + Restlet + Proguard
ODataInteface -> com.voicepro.odata.u BraniList -> com.voicepro.odata.BraniList BraniList$5 -> com.voicepro.odata.m: Attached only two classes as the reference you looking for are all in this two classes. Thank you for help. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971675 ODataInteface.java Description: Binary data BraniList.java Description: Binary data
RE: Android + Restlet + Proguard
Hi Giuseppe, You're in luck, even connected on Sunday ;) Could you post the source code of the following classes, before and after ProGuard? com.voicepro.odata.u.b com.voicepro.odata.BraniList.a com.voicepro.odata.BraniList.d com.voicepro.odata.m.doInBackground com.voicepro.odata.m.doInBackground Best regards, Jerome -- http://www.restlet.com http://twitter.com/#!/jlouvel -Message d'origine- De : Giuseppe Porcelli [mailto:porcelli.giuse...@gmail.com] Envoyé : dimanche 17 juin 2012 01:21 À : discuss@restlet.tigris.org Objet : RE: Android + Restlet + Proguard Hi Jerome, please don't forgot me as I have to publish the update by tomorrow. Thank you very much. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29715 79 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971664
RE: Android + Restlet + Proguard
Hi Jerome, please don't forgot me as I have to publish the update by tomorrow. Thank you very much. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971579
RE: Android + Restlet + Proguard
And attached also my proguard file -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971465# This is a configuration file for ProGuard. # http://proguard.sourceforge.net/index.html#manual/usage.html -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose -dontwarn javax.xml.** -dontwarn com.sun.** -dontwarn org.odata4j.** #-dontwarn org.restlet.** # Optimization is turned off by default. Dex does not like code run # through the ProGuard optimize and preverify steps (and performs some # of these optimizations on its own). -dontshrink -dontoptimize -dontpreverify # If you want to enable optimization, you should include the # following: # -optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/* # -optimizationpasses 5 # -allowaccessmodification # # Note that you cannot just include these flags in your own # configuration file; if you are including this file, optimization # will be turned off. You'll need to either edit this file, or # duplicate the contents of this file and remove the include of this # file from your project's proguard.config path property. #-ignorewarnings -keepdirectories -keepattributes *Annotation* -libraryjars /libs/odata4j-0.6.0-nojpabundle.jar -libraryjars /libs/acra-4.2.3.jar -libraryjars /libs/org.restlet.ext.atom.jar -libraryjars /libs/org.restlet.ext.crypto.jar -libraryjars /libs/org.restlet.ext.httpclient.jar -libraryjars /libs/org.restlet.ext.jaas.jar -libraryjars /libs/org.restlet.ext.json.jar -libraryjars /libs/org.restlet.ext.net.jar -libraryjars /libs/org.restlet.ext.odata.jar -libraryjars /libs/org.restlet.ext.rdf.jar -libraryjars /libs/org.restlet.ext.xml.jar -libraryjars /libs/org.restlet.jar -libraryjars /lib/rt.jar(java/**,javax/**) -keep public class * extends android.app.Activity -keep public class * extends com.actionbarsherlock.app.SherlockActivity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class * extends android.app.backup.BackupAgent -keep public class * extends android.preference.Preference -keep public class * extends android.support.v4.app.Fragment -keep public class * extends android.app.Fragment -keep public class * extends org.restlet.ext.odata.Service -keep public class com.android.vending.licensing.ILicensingService -keep class com.actionbarsherlock.** { *; } -keep interface com.actionbarsherlock.** { *; } -keep class org.** { *; } -keep class com.sun.** { *; } -keep class org.odata4j.** { *; } -keep class javax.** { *; } -keep public class com.android.vending.licensing.ILicensingService -keep class org.restlet.** { *; } # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native ; } -keep public class * extends android.view.View { public (android.content.Context); public (android.content.Context, android.util.AttributeSet); public (android.content.Context, android.util.AttributeSet, int); public void set*(...); } -keepclassmembers class * extends android.os.AsyncTask { protected void onPreExecute(); protected *** doInBackground(...); protected void onPostExecute(...); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public (android.content.Context, android.util.AttributeSet, int); } -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keepclassmembers class **.R$* { public static ; } # The support library contains references to newer platform versions. # Don't warn about those in case this app is linking against an older # platform version. We know about them, and they are safe. -dontwarn android.support.** #ACRA specifics # we need line numbers in our stack traces otherwise they are pretty useless -renamesourcefileattribute SourceFile -keepattributes SourceFile,LineNumberTable # ACRA needs "annotations" so add this... -keepattributes *Annotation* # keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'. # Note: if you are removing log messages elsewhere in this file then this isn't necessary -keep class org.acra.ACRA { *; } # keep this around for some enums that ACRA needs -keep class org.acra.ReportingInteractionMode { *; } # keep this otherwise it is removed by ProGuard -keep public class org.acra.ErrorRep
RE: Android + Restlet + Proguard
Hi Jerome, firstall thank you for the answer on Saturday !!! Attached the stack trace file. Giuseppe P.S. waiting for your answer, as we published the app and didn't know about this problem, so getting errors from customers. -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=297146406-16 12:25:09.380: I/com.voicepro.services.PlayerService(21177): com.voicepro.services.PlayerServiceonCreate() 06-16 12:25:09.385: I/com.voicepro.services.PlayerService(21177): Received start id 1: Intent { cmp=com.voicepro/.services.PlayerService } 06-16 12:25:12.705: V/wsbuilder(21177): http://service.ag-software.it/data.svc/ 06-16 12:25:12.880: W/CursorWrapperInner(21177): Cursor finalized without prior close() 06-16 12:25:12.885: D/dalvikvm(21177): GC_CONCURRENT freed 2337K, 15% free 14683K/17095K, paused 1ms+5ms 06-16 12:25:13.010: D/dalvikvm(21177): GC_CONCURRENT freed 1667K, 13% free 14960K/17095K, paused 2ms+3ms 06-16 12:25:13.250: D/dalvikvm(21177): GC_CONCURRENT freed 878K, 7% free 16026K/17095K, paused 2ms+2ms 06-16 12:25:13.405: I/org.restlet(21177): Starting the default HTTP client 06-16 12:25:13.625: I/org.restlet(21177): Get the metadata for http://192.168.1.103/WBVoice4Facebook/Data.svc/ at http://192.168.1.103/WBVoice4Facebook/Data.svc/$metadata 06-16 12:25:13.645: I/org.restlet(21177): Starting the default HTTP client 06-16 12:25:14.040: I/org.restlet(21177): Starting the default HTTP client 06-16 12:25:14.500: D/dalvikvm(21177): GC_CONCURRENT freed 1390K, 9% free 16647K/18119K, paused 14ms+5ms 06-16 12:25:14.500: I/org.restlet(21177): Stopping the default HTTP client 06-16 12:25:14.640: W/System.err(21177): java.lang.NullPointerException: println needs a message 06-16 12:25:14.640: W/System.err(21177):at android.util.Log.println_native(Native Method) 06-16 12:25:14.640: W/System.err(21177):at android.util.Log.v(Log.java:117) 06-16 12:25:14.640: W/System.err(21177):at com.voicepro.odata.u.b(SourceFile:111) 06-16 12:25:14.640: W/System.err(21177):at com.voicepro.odata.BraniList.a(SourceFile:206) 06-16 12:25:14.640: W/System.err(21177):at com.voicepro.odata.BraniList.d(SourceFile:202) 06-16 12:25:14.640: W/System.err(21177):at com.voicepro.odata.m.doInBackground(SourceFile:164) 06-16 12:25:14.640: W/System.err(21177):at com.voicepro.odata.m.doInBackground(SourceFile:1) 06-16 12:25:14.640: W/System.err(21177):at android.os.AsyncTask$2.call(AsyncTask.java:264) 06-16 12:25:14.640: W/System.err(21177):at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305) 06-16 12:25:14.640: W/System.err(21177):at java.util.concurrent.FutureTask.run(FutureTask.java:137) 06-16 12:25:14.645: W/System.err(21177):at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208) 06-16 12:25:14.645: W/System.err(21177):at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076) 06-16 12:25:14.645: W/System.err(21177):at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569) 06-16 12:25:14.645: W/System.err(21177):at java.lang.Thread.run(Thread.java:856) 06-16 12:25:14.715: I/org.restlet(21177): Stopping the default HTTP client
RE: Android + Restlet + Proguard
Hi Giuseppe, Could you share the detailled stack trace? Best regards, Jerome -- http://www.restlet.com http://twitter.com/#!/jlouvel -Message d'origine- De : Giuseppe Porcelli [mailto:porcelli.giuse...@gmail.com] Envoyé : samedi 16 juin 2012 11:51 À : discuss@restlet.tigris.org Objet : Android + Restlet + Proguard In debug mode my app that use Odata Ext from Restlet, work very well. If I try to publish the app and use PROGUARD, in proguard logs there are no errors, but the app have exception NullPointerException. Any help how to set PROGUARD config file? -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=29714 57 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2971462