I'm stumped as to what is wrong or what I can do to fix the problem, I've tried google and this forum but have not found anything to help me. Is there anything I can do to fix this issue?
I have also added an ical4j.properties file to the root of my src directory but I get a message saying that it cant find it (which can also be seen above). I'd also be delighted if you could help me fix this too.
Thanks.
Is mise le meas,
Ian
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I suspect both of these issues are related, as it seems resources are not being loaded correctly from the classpath. Here is the static code in TimeZoneRegistryImpl that is most likely the cause of the ExceptionInInitializerError:
I am not sure if anything changed recently on Android, but I have run some simple tests with 2.1 and it worked ok. Make sure you are including resources in the final APK being generated, otherwise I will try to test it when I get some time.
regards,
ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-14
I have the same problem in Android.
The call works fine if I do it from an Activity, but when I run it from a Service this happens.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-14
Oh and I also get this error right before it crashes:
I/Configurator(19472): ical4j.properties not found.
I think it may be the cause.
Where am I supposed to put this file? I've tried almost every folder there is, but it still won't see it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-14
Okay, problem solved. It was indeed because it did not see the ical4j.properties file, which should be located in the base of your src/ folder. Additionally you have to restart Eclipse before it will register the file.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-14
Nevermind. That wasn't it. It sort of worked for a while (not sure what happened, maybe the program just didn't launch properly), but now it's back again.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-08-14
The problem is that CalendarBuilder is not thread-safe. That is why it's not going to work in a Service. Is there already a bug report on this?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I haven't tried this project recently, but it was parsing and loading calendar files last time I checked. Note that this doesn't use Android services tho, so the initial issue here may be related to something I am not aware of.
regards,
ben
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The statements without a leading slash give a null result, but the ones WITH a leading slash give the correct jar path. So it seems that the leading slash is necessary, but the static block in TimeZoneRegistryImpl doesn't use it.
Hope that helps.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am trying to use the jar, but I am missing tz.alias along with all the ics files in my apk (verified using baksmali)? I added the ical4j as a static lib in my Android.mk, but I am missing something which would tell the apk to keep the non-java files that are not specified as resources and/or assets. Or should I define them as assets? Any help would be appreciated.
Thanks.
Last edit: Parag 2015-09-24
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm trying to parse a downloaded ical file in an android project with ical4j.
I have added the following files to my libs directory and added them into the build path using the android plugin.
I am getting an error when I call
The error is
I'm stumped as to what is wrong or what I can do to fix the problem, I've tried google and this forum but have not found anything to help me. Is there anything I can do to fix this issue?
I have also added an ical4j.properties file to the root of my src directory but I get a message saying that it cant find it (which can also be seen above). I'd also be delighted if you could help me fix this too.
Thanks.
Is mise le meas,
Ian
Hi Ian,
I suspect both of these issues are related, as it seems resources are not being loaded correctly from the classpath. Here is the static code in TimeZoneRegistryImpl that is most likely the cause of the ExceptionInInitializerError:
I am not sure if anything changed recently on Android, but I have run some simple tests with 2.1 and it worked ok. Make sure you are including resources in the final APK being generated, otherwise I will try to test it when I get some time.
regards,
ben
I have the same problem in Android.
The call works fine if I do it from an Activity, but when I run it from a Service this happens.
Oh and I also get this error right before it crashes:
I/Configurator(19472): ical4j.properties not found.
I think it may be the cause.
Where am I supposed to put this file? I've tried almost every folder there is, but it still won't see it.
Okay, problem solved. It was indeed because it did not see the ical4j.properties file, which should be located in the base of your src/ folder. Additionally you have to restart Eclipse before it will register the file.
Nevermind. That wasn't it. It sort of worked for a while (not sure what happened, maybe the program just didn't launch properly), but now it's back again.
The problem is that CalendarBuilder is not thread-safe. That is why it's not going to work in a Service. Is there already a bug report on this?
Did anyone find a solution or workaround for this?
Also note I have verified the "tz.alias" file exists in the ical4j jar that fortuna mentions.
I haven't had much time to investigate this, however if you want to look at an example of using ical4j in Android there is this:
http://ical4j.hg.sourceforge.net/hgweb/ical4j/ical4j-android-test/
I haven't tried this project recently, but it was parsing and loading calendar files last time I checked. Note that this doesn't use Android services tho, so the initial issue here may be related to something I am not aware of.
regards,
ben
I have the same problem when using a service.
I tested the following log statements from ical4j-android-test:
The statements without a leading slash give a null result, but the ones WITH a leading slash give the correct jar path. So it seems that the leading slash is necessary, but the static block in TimeZoneRegistryImpl doesn't use it.
Hope that helps.
Hi guys. I found fix! The problem seems to be the class ResourceLoader. The following statement failes with a NPE.
This is because
returns null.
So I tried to set the context class loader as follows
an it works!
I am trying to use the jar, but I am missing tz.alias along with all the ics files in my apk (verified using baksmali)? I added the ical4j as a static lib in my Android.mk, but I am missing something which would tell the apk to keep the non-java files that are not specified as resources and/or assets. Or should I define them as assets? Any help would be appreciated.
Thanks.
Last edit: Parag 2015-09-24