opensciencemap / vtm

a vector-tile map library written in java - running on android, desktop and within the browser
GNU Lesser General Public License v3.0
238 stars 176 forks source link

Always getting ExceptionInInitializerError at 'setContentView(...)' #74

Closed mrunde closed 10 years ago

mrunde commented 10 years ago

Hi,

I always get an ExceptionInInitializerError when I set the content view in the onCreate(...) function with setContentView(R.layout.main);. Do you have any idea what I may have done wrong? When I use the MapView from MapQuest it works. I followed your example from BaseMapActivity. You can find my main layout here.

Thanks in advance! Marius

hjanetzek commented 10 years ago

Hi, how do you run your application? in which IDE? The error might come from 'vtm' or 'vtm-android' not being packaged into the apk

mrunde commented 10 years ago

I'm using eclipse and have the vtm and vtm-android folders added to the build path as JARs.

hjanetzek commented 10 years ago

With eclipse one has to include android library projects also as eclipse project otherwise files from 'res' folders are not added to the apk

mrunde commented 10 years ago

I have these external libraries included in the project to use the vtm:

I can use all files from the res folder so I don't think that this might be the problem.

hjanetzek commented 10 years ago

Did you create the vtm jars with gradle? If not, you can run './gradlew --info clean install' to see where gradle puts them and then include them manually in your project - vtm,vtm-android and vtm-themes are the ones you need.

mrunde commented 10 years ago

Oh, I think that was the error. I didn't use gradle and created the jars manually. Thanks for your help.