khanhnguyenviet / foursquared

Automatically exported from code.google.com/p/foursquared
Apache License 2.0
0 stars 0 forks source link

SD Card availability should not cause crashes #91

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Plug phone into computer
2. "mount" phone to view files.
3. Load foursquare
4. Watch crash.

What is the expected output? What do you see instead?

At the very least, there should be a warning stating that an sdcard is 
required to use foursquare.

I/ActivityManager(   52): Starting activity: Intent { 
action=android.intent.action.MAIN 
categories={android.intent.category.LAUNCHER} flags=0x10200000 
comp={com.joelapenna.foursquared/com.joelapenna.foursquared.MainActivity} }
I/ActivityManager(   52): Start proc com.joelapenna.foursquared for 
activity com.joelapenna.foursquared/.MainActivity: pid=2708 uid=10028 
gids={3003}
I/dalvikvm( 2708): Debugger thread not active, ignoring DDM send 
(t=0x41504e4d l=38)
I/ActivityManager(   52): Process com.android.mms (pid 2692) has died.
I/dalvikvm( 2708): Debugger thread not active, ignoring DDM send 
(t=0x41504e4d l=56)
W/AudioFlinger(   35): write blocked for 109 msecs
D/AndroidRuntime( 2708): Shutting down VM
W/dalvikvm( 2708): threadid=3: thread exiting with uncaught exception 
(group=0x4000fe70)
E/AndroidRuntime( 2708): Uncaught handler: thread main exiting due to 
uncaught exception
E/AndroidRuntime( 2708): java.lang.RuntimeException: Unable to instantiate 
application com.joelapenna.foursquared.Foursquared: 
java.lang.IllegalStateException: Unable to create nomedia file.
E/AndroidRuntime( 2708): at 
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:
464)
E/AndroidRuntime( 2708): at 
android.app.ActivityThread.handleBindApplication(ActivityThread.java:3613)
E/AndroidRuntime( 2708): at 
android.app.ActivityThread.access$2500(ActivityThread.java:112)
E/AndroidRuntime( 2708): at 
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1729)
E/AndroidRuntime( 2708): at 
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 2708): at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 2708): at 
android.app.ActivityThread.main(ActivityThread.java:3948)
E/AndroidRuntime( 2708): at java.lang.reflect.Method.invokeNative(Native 
Method)
E/AndroidRuntime( 2708): at 
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 2708): at 
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:
782)
E/AndroidRuntime( 2708): at 
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 2708): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 2708): Caused by: java.lang.IllegalStateException: Unable 
to create nomedia file.
E/AndroidRuntime( 2708): at 
com.joelapenna.foursquared.util.BaseDiskCache.createDirectory(BaseDiskCache
.java:88)
E/AndroidRuntime( 2708): at 
com.joelapenna.foursquared.util.BaseDiskCache.<init>(BaseDiskCache.java:32)
E/AndroidRuntime( 2708): at 
com.joelapenna.foursquared.util.RemoteResourceManager.<init>(RemoteResource
Manager.java:30)
E/AndroidRuntime( 2708): at 
com.joelapenna.foursquared.Foursquared.<init>(Foursquared.java:48)
E/AndroidRuntime( 2708): at java.lang.Class.newInstanceImpl(Native Method)
E/AndroidRuntime( 2708): at java.lang.Class.newInstance(Class.java:1472)
E/AndroidRuntime( 2708): at 
android.app.Instrumentation.newApplication(Instrumentation.java:1033)
E/AndroidRuntime( 2708): at 
android.app.Instrumentation.newApplication(Instrumentation.java:1018)
E/AndroidRuntime( 2708): at 
android.app.ActivityThread$PackageInfo.makeApplication(ActivityThread.java:
459)
E/AndroidRuntime( 2708): ... 11 more

Original issue reported on code.google.com by jlapenna on 9 Sep 2009 at 1:55

GoogleCodeExporter commented 8 years ago
Additionally, we shouldn't so severely mask the source exception in 
BaseDiskCache.java without declaring what it was:

            try {
                nomediaFile.createNewFile();
            } catch (IOException e) {
                throw new IllegalStateException("Unable to create nomedia file.");
            }

Original comment by jlapenna on 9 Sep 2009 at 2:10

GoogleCodeExporter commented 8 years ago
http://codereview.appspot.com/120052 Should resolve this.

Original comment by jlapenna on 21 Sep 2009 at 2:20

GoogleCodeExporter commented 8 years ago

Original comment by jlapenna on 21 Sep 2009 at 3:04

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

Original comment by jlapenna on 25 Sep 2009 at 4:36