Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Resource not found" when building Android app under IntelliJ 9.0 Maia Public Beta

I'm trying to port an app from Eclipse to IntelliJ. The app builds fine but it fails to run properly.

Here's a partial stack trace I receive:

ERROR/AndroidRuntime(957):             
java.io.IOException: Resource not found: "org/joda/time/tz/data/ZoneInfoMap" ClassLoader: dalvik.system.PathClassLoader@43761190
        at org.joda.time.tz.ZoneInfoProvider.openResource(ZoneInfoProvider.java:209)
        at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:123)
        at org.joda.time.tz.ZoneInfoProvider.<init>(ZoneInfoProvider.java:82)
        at org.joda.time.DateTimeZone.getDefaultProvider(DateTimeZone.java:439)
        at org.joda.time.DateTimeZone.setProvider0(DateTimeZone.java:393)
        at org.joda.time.DateTimeZone.<clinit>(DateTimeZone.java:114)
        at org.joda.time.chrono.GregorianChronology.<clinit>(GregorianChronology.java:71)
        at org.joda.time.chrono.ISOChronology.<clinit>(ISOChronology.java:66)
        at org.joda.time.base.BaseDateTime.<init>(BaseDateTime.java:97)
        at org.joda.time.DateTime.<init>(DateTime.java:120)

For some reason, the app isn't able to find the joda-time resources, even though they're specified in the module's build path. These are the same jarfiles used by the eclipse version of the app.

alt text http://img.skitch.com/20091106-pgqujbb5eaeqc2wfiqc2c1p39a.png

The APK built by the IntelliJ tool is about 20% smaller than the one built by Eclipse, but I don't know why.

Any idea what might be the problem?

UPDATE:

I spoke with romain and xav yesterday, and it appears that the problem is that intellij is not bundling resources into the apk. Evidently aapt does a two pass approach - first it bundles all the class files into a .dex file, and then it bundles all of the resource files separately into the top level of the apk file. It's this second pass that intellij seems to be missing.

As a workaround, they suggested that I unjar all the resource files from the joda-time jar, and place them in my src directory. The expectation was that intellij would then bundle them into my apk as though they were part of my own source, thus solving the problem. However, when I did this, IntelliJ ignored those files entirely when it created the apk.

I don't know why. Is there maybe a workaround I can use to get the joda-time resource files into my apk that isn't terribly inconvenient every time I want to build?

like image 930
emmby Avatar asked Nov 06 '09 21:11

emmby


1 Answers

This is a pretty old version of intellij at this point. 10.5 seems to resolve all of my issues with android dev

like image 199
emmby Avatar answered Oct 14 '22 08:10

emmby