Lorentech / market-enabler

Automatically exported from code.google.com/p/market-enabler
0 stars 0 forks source link

java.lang.NumberFormatException: unable to parse '' as integer #66

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Install MarketEnabler 3.0.8
2. Launch Market Enabler
3. Force Close

What is the expected output? What do you see instead?
I expected to be able to select T-MO USA

What version of the product are you using? On what ROM?
3.0.8 on CMod 4.2.15.1. I wiped before installing CMod 4.2.15.1

Please provide any additional information below.

Attach a logcat output if possible.
D/AndroidRuntime( 2305): Shutting down VM
W/dalvikvm( 2305): threadid=3: thread exiting with uncaught exception
(group=0x4001e180)
E/AndroidRuntime( 2305): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 2305): java.lang.RuntimeException: Unable to start
service com.androidiani.MarketEnabler.update.Update@43a6d398 with Intent {
cmp=com.androidiani.MarketEnabler/.update.Update }:
java.lang.NumberFormatException: unable to parse '' as integer
E/AndroidRuntime( 2305):    at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2878)
E/AndroidRuntime( 2305):    at
android.app.ActivityThread.access$3500(ActivityThread.java:118)
E/AndroidRuntime( 2305):    at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1925)
E/AndroidRuntime( 2305):    at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2305):    at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2305):    at
android.app.ActivityThread.main(ActivityThread.java:4358)
E/AndroidRuntime( 2305):    at java.lang.reflect.Method.invokeNative(Native
Method)
E/AndroidRuntime( 2305):    at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2305):    at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:791)
E/AndroidRuntime( 2305):    at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:549)
E/AndroidRuntime( 2305):    at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2305): Caused by: java.lang.NumberFormatException: unable
to parse '' as integer
E/AndroidRuntime( 2305):    at java.lang.Integer.parseInt(Integer.java:353)
E/AndroidRuntime( 2305):    at java.lang.Integer.parseInt(Integer.java:323)
E/AndroidRuntime( 2305):    at
com.androidiani.MarketEnabler.update.Update.checkForUpdate(Update.java:101)
E/AndroidRuntime( 2305):    at
com.androidiani.MarketEnabler.update.Update.onStart(Update.java:77)
E/AndroidRuntime( 2305):    at
android.app.Service.onStartCommand(Service.java:306)
E/AndroidRuntime( 2305):    at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2869)
E/AndroidRuntime( 2305):    ... 10 more

Would gladly help debug it out. 

Original issue reported on code.google.com by nushio on 17 May 2010 at 8:07

GoogleCodeExporter commented 8 years ago
Whooops... that shouldn't happen...
I havent really analized it but from your logcat it's almost clear to me that 
the
update check fails.
It wil retrieve the file
http://market-enabler.googlecode.com/svn/branches/MarketChanger%20Starter%20list
/update/latestversion
and expect the content to be numeric.
Somehow you get a different content and this should be handled and a catch 
clause
should inform the user that the updatecheck failed and maybe show him the server
response instead of just throwing the error to his parent...

Original comment by michel.racic on 17 May 2010 at 8:19

GoogleCodeExporter commented 8 years ago
Thanks Michel. When I tried to use the ME, that file was completely blank. (It 
could
have been that I tried to use it during Google Code Maintenance)

I tried Market Enabler right now, and it seems to work. 

I'm glad to have caught a (rare?) bug. 

Thanks again. 

Original comment by nushio on 19 May 2010 at 1:43

GoogleCodeExporter commented 8 years ago
It shouldn't be (code maintenance should just make it read only) but it can have
happened during maintenance.
Nevertheless, thx a lot for your report because such little mistakes shouldn't 
happen.

To fix:
- add empty check and handle throw if it's nut an int.
Update.java:
try {
   latestVersion = Integer.parseInt(getHttpString(urlLatestVersion));
} catch (IOException e1) {
  Log.i(logName, e1.getLocalizedMessage());
  return false;
} catch (NumberFormatException e2) {
  Log.i(logName, e1.getLocalizedMessage());
  return false;
}

Original comment by michel.racic on 19 May 2010 at 7:45

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r182.

Original comment by michel.racic on 5 Nov 2010 at 2:41

GoogleCodeExporter commented 8 years ago
Fixed with r182

Original comment by michel.racic on 5 Nov 2010 at 2:41