Dex cache issue

by nickname » Fri, 23 Apr 2010 08:05:15 GMT


Sponsored Links
 i all,
My application is crashing once in a while . Logcat logs are pasted
bellow.

04-11 02:26:37.225 1245 1245 W dalvikvm: Refusing to reopen boot DEX '/
system/framework/frameworks.jar'
04-11 02:26:37.334 1245 1245 E dalvikvm: Can't open dex cache '/data/
dalvik-cache/sys...@app@settings....@classes.dex': No such file or
directory
04-11 02:26:37.345 1245 1245 I dalvikvm: Unable to open or create
cache for /system/app/Settings.apk (/data/dalvik-cache/
sys...@app@settings....@classes.dex)
04-11 02:26:37.350 1245 1245 D AndroidRuntime: Shutting down VM
04-11 02:26:37.373 1245 1245 W dalvikvm: threadid=3: thread exiting
with uncaught exception (group=0x4001e600)
04-11 02:26:37.373 1245 1245 E AndroidRuntime: Uncaught handler:
thread main exiting due to uncaught exception
04-11 02:26:37.389 1245 1245 E AndroidRuntime:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.android.setupwizard/
com.android.setupwizard.SetupWirelessActivity}:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.android.settings/
com.android.settings.wifi.WifiSettings}:
java.lang.ClassNotFoundException:
com.android.settings.wifi.WifiSettings in loader
dalvik.system.pathclassloa...@44f0d8d8
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2550)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2566)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.access$2400(ActivityThread.java:121)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1917)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.os.Handler.dispatchMessage(Handler.java:99)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.os.Looper.loop(Looper.java:123)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.main(ActivityThread.java:4417)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
java.lang.reflect.Method.invokeNative(Native Method)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
java.lang.reflect.Method.invoke(Method.java:521)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
dalvik.system.NativeStart.main(Native Method)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: Caused by:
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.android.settings/
com.android.settings.wifi.WifiSettings}:
java.lang.ClassNotFoundException:
com.android.settings.wifi.WifiSettings in loader
dalvik.system.pathclassloa...@44f0d8d8
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2471)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.ActivityThread.startActivityNow(ActivityThread.java:2389)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.LocalActivityManager.moveToState(LocalActivityManager.java:
127)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
android.app.LocalActivityManager.startActivity(LocalActivityManager.java:
339)
04-11 02:26:37.389 1245 1245 E AndroidRuntime: at
com.an



Other Threads

1. Speeding up builds on large projects - rename "png" to "PNG"

I ran into a problem of slow builds and thought I'd share the
solution.

I'm porting an iPhone app to Android, and as soon as I added the
images to the project (400+ pngs), build time went from about 5
seconds to about 40 seconds. This is on a new machine, quad core i7,
8GB ram.

The resource processor (aapt) was to blame. Every time I made a change
to a layout xml file and hit save - bam, wait 40 seconds.

After running aapt in verbose mode, it was obvious what was happening
- aapt does png optimization every single time. Optimization is slow,
and aapt only used one core. So it makes sense to turn this
optimization off. Just run optipng once, no need to optimize every
build or every time I save a layout xml file.

So how do you turn png optimization off? You can't. There is no
Eclipse setting, no command line option for aapt.

Digging around the aapt source, I noticed something funny though - it
only optimizes images in the "drawable" folders that end in ".png".
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=tools/aapt/Images.cpp#l973

Solution: rename all the pngs to end in uppercase ".PNG". Then aapt
simply copies the files without optimizing. My build time is back to 5
seconds!

(Caveat: this won't work for nine-patch files - they still need to end
in lowercase ".9.png".)

-- 

2. Using Eclipse - can it get faster?

Hi all. I'm sure like many of you, I use Eclipse for my development.

The problem with it is, I find it incredibly memory hungry... it often
takes ages to load up, when I save a file it hangs for a while (saying
"Building workspace" in the bottom right hand corner), and is just
generally slow.

I wondered if anyone had any tips for streamlining it for Android. I
don't use it for anything else (if necessary, I will install a
separate instance for general Java stuff) so I can't help thinking
there are lots of modules and stuff I could get rid of which may help
it run more smoothly.

Anyone have some tips on this?

-- 

3. JSON Parsing Error

4. Video Streaming in Android Emulator Possible ?.

5. Announcing Corona SDK for cross-platform app development

6. Opportuniy as Android Developer in Warren NJ

7. Turning on sync in Android emulator