Giter VIP home page Giter VIP logo

Comments (22)

jgriffiths avatar jgriffiths commented on August 25, 2024 1

@mzagol Has confirmed the fix works for this issue, many thanks. I have pushed and updated the Changelog.

Paging @dschuermann - can you release v2.3 when you have a moment?

Those above affected, please try v2.3 once its released.

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

@kopp Thanks for the report. Is it possible for you to enable debug logging in the settings menu and post the resulting output just before the crash? I don't have Google calendar to reproduce with. Thanks!

from calendar-import-export.

kopp avatar kopp commented on August 25, 2024

@jgriffiths sure. In the following, Developer Settings are enabled as well as Debug Logging. I'm not sure if it worked, though: I see almost no D output. Note the lines that have a trailing #<num> for comments below.

Before taking this log, I ended the app (app settings, stop app).

W/InputMethodManagerService(  402): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2b9fd8e8 attribute=null #1
W/InputMethodManagerService(  402): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@2b95fa40 attribute=null #1
D/PhoneStatusBar(  494): addNotification score=0
E/log_tag (  556): 1. NullPointerException: java.lang.NullPointerException #2
I/ICS_SaveCalendar(27198): Save id 3 to file /storage/sdcard0/Coriexporttest.ics
E/DatabaseUtils(27102): Writing exception to parcel
E/DatabaseUtils(27102): java.lang.NullPointerException
E/DatabaseUtils(27102):         at android.database.sqlite.SQLiteQueryBuilder.computeProjection(SQLiteQueryBuilder.java:625)
E/DatabaseUtils(27102):         at android.database.sqlite.SQLiteQueryBuilder.buildQuery(SQLiteQueryBuilder.java:447)
E/DatabaseUtils(27102):         at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:393)
E/DatabaseUtils(27102):         at android.database.sqlite.SQLiteQueryBuilder.query(SQLiteQueryBuilder.java:333)
E/DatabaseUtils(27102):         at com.android.providers.calendar.CalendarProvider2.query(CalendarProvider2.java:1029)
E/DatabaseUtils(27102):         at com.android.providers.calendar.CalendarProvider2.query(CalendarProvider2.java:1000)
E/DatabaseUtils(27102):         at android.content.ContentProvider.query(ContentProvider.java:652)
E/DatabaseUtils(27102):         at android.content.ContentProvider$Transport.query(ContentProvider.java:189)
E/DatabaseUtils(27102):         at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:113)
E/DatabaseUtils(27102):         at android.os.Binder.execTransact(Binder.java:367)
E/DatabaseUtils(27102):         at dalvik.system.NativeStart.run(Native Method)
E/ICS_RunnableWithProgress(27198): An exception occurred
E/ICS_RunnableWithProgress(27198): java.lang.NullPointerException
E/ICS_RunnableWithProgress(27198):      at android.os.Parcel.readException(Parcel.java:1431)
E/ICS_RunnableWithProgress(27198):      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
E/ICS_RunnableWithProgress(27198):      at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:140)
E/ICS_RunnableWithProgress(27198):      at android.content.ContentProviderProxy.query(ContentProviderNative.java:366)
E/ICS_RunnableWithProgress(27198):      at android.content.ContentResolver.query(ContentResolver.java:370)
E/ICS_RunnableWithProgress(27198):      at android.content.ContentResolver.query(ContentResolver.java:313)
E/ICS_RunnableWithProgress(27198):      at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
E/ICS_RunnableWithProgress(27198):      at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
E/ICS_RunnableWithProgress(27198):      at java.lang.Thread.run(Thread.java:856)
I/dalvikvm(  494): Jit: resizing JitTable from 8192 to 16384 #3
  • #1 This happens, when I select different calendars to export
  • #2 This happens, when I hit //Export//
  • #3 Here I exit the app (go to home screen)

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

This looks difficult to diagnose without debugging. The crash is caused by simply querying the calendar provider. Here is the call site:

        ContentResolver resolver = activity.getContentResolver();
        String where = Events.CALENDAR_ID + "=?";
        String[] args = new String[] { selectedCal.mIdStr };
        Cursor cur = resolver.query(Events.CONTENT_URI, EVENT_COLS, where, args, null);

We pass null as the sort order but this is documented as using the default sort. I wonder if the CM 10 calendar provider was altered or broken in respect to this param.

from calendar-import-export.

ulbu avatar ulbu commented on August 25, 2024

Hello,
I have the same problem with Sony Ericson xperia (android 4.0.4). I have enabled the debug option but I can't find any file in filesystem to send to you. (the app was downloaded last week).

from calendar-import-export.

xabolcs avatar xabolcs commented on August 25, 2024

Hello!
Sorry for the spam! I got this NPE too.
I managed to find that my calendar entries have Etc/GMT-1, Etc/GMT-2, GMT and even UTC in their eventTimezone.
And in top of all, I'm in CET/CEST timezone.

A workaround for me was to adjust the source code to apply my timezone as default timezone.

from calendar-import-export.

mzagol avatar mzagol commented on August 25, 2024

I get same error on android v4.0.4 and, like @ulbu, I cannot file any debug file on the filesystem with Debug logging enabled.

from calendar-import-export.

pdwhittaker avatar pdwhittaker commented on August 25, 2024

I've noticed a couple of things that might help:

  • For me the "null" error doesn't appear until part-way through the export. The progress bar reliably gets to a predictable point (item 13/17 in my case when I first hit this) before throwing the error.
  • After reading the comments above I looked for calendar entries that had a timezone specified, and altered it (from "British Summer Time" to "GMT +0100" in my case). Each time I did this, it changed the point in the export progress bar at which the null error appeared, and in each case the error happened earlier, often several items earlier. (After changing four or five entries it's now very early, somewhere around 2 or 3 out of 17.)

Based on the above, this appears to me (on my phone at least) to be a problem processing individual calendar entries, and I'd agree with @xabolcs that it's likely timezone-related.

As with the original report from @kopp I'm seeing this with a calendar from the sufficientlysecure.org OfflineCalendar app. It does not appear to be a problem contacting the calendar for me (possibly due to the fix by @jgriffiths), because I was reliably getting 13/17 entries through the calendar before the error dialog was displayed. I'm running version 2.2, installed via F-Droid.

For reference, I have another OfflineCalendar on the same phone that reliably exports without any problems (for now at least), and I also encounter this exporting error a couple of hundred items into one of my Google calendars. I don't care so much about the error on the Google calendar, though, because I have the alternative option of exporting that one via their website.

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

Hi,

With debug logging enabled, the information will be output in the logcat of the device, not in a specific file on disk. Getting the log is slightly technical: see http://forum.xda-developers.com/showthread.php?t=1726238 for a few different methods.

The log will be large and may contain personal info. For debugging, only lines containing ICS_ are required, so please filter them out using grep or a similar tool.

from calendar-import-export.

pdwhittaker avatar pdwhittaker commented on August 25, 2024

Thanks @jgriffiths. I should be able to give that a try later, and I'll post back what I find.

In the meantime, does anyone know of any workaround or other approach that we can use to back up OfflineCalendar local calendars? Not necessarily an ICS export, just anything we can take off the device and restore later.

(Apologies if that question appears off-topic: as far as I can tell, though, this app is the only way of backing up those local calendars, and I came to this bug report after installing Calendar Import/Export for just this one purpose.)

from calendar-import-export.

mzagol avatar mzagol commented on August 25, 2024

Thank you @jgriffiths for the logging instructions. Below's mine:

05-19 09:42:38.716 I/ICS_SaveCalendar(18941): Save id 1 to file /mnt/sdcard/export.log.ics
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941): An exception occurred
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941): java.lang.NullPointerException
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at android.os.Parcel.readException(Parcel.java:1333)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:182)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:136)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at android.content.ContentProviderProxy.query(ContentProviderNative.java:358)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at android.content.ContentResolver.query(ContentResolver.java:312)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
05-19 09:42:38.727 E/ICS_RunnableWithProgress(18941):   at java.lang.Thread.run(Thread.java:856)

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

I have a speculative change that may fix this. If anyone is able to install a debug .apk to test it please let me know and I will email you a copy to test. (This will be significantly faster than pushing out releases through fdroid/play store if we need to iterate the changes).

@pdwhittaker If your export gets part way through then I think your issue is different. We can confirm this with a debug log if you can get one.

from calendar-import-export.

mzagol avatar mzagol commented on August 25, 2024

@jgriffiths I'm happy to give it a shot.

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

@mzagol, great, thanks. If you email me at [redacted to prevent harvesting] I will email you back the apk to test (~1.5 MB).

from calendar-import-export.

Gitoffthelawn avatar Gitoffthelawn commented on August 25, 2024

@pdwhittaker

In the meantime, does anyone know of any workaround or other approach that we can use to back up OfflineCalendar local calendars? Not necessarily an ICS export, just anything we can take off the device and restore later.
Apologies if that question appears off-topic: as far as I can tell, though, this app is the only way of backing up those local calendars, and I came to this bug report after installing Calendar Import/Export for just this one purpose.

FWIW and if it helps you, I believe Business Calendar and Business Calendar 2 will both export local calendars. Also, I think aCalendar might also have this functionality. They are all paid closed-source apps, but if you are willing to use closed-source applications, I think the feature-limited free versions of these apps may have the export feature enabled.

from calendar-import-export.

pdwhittaker avatar pdwhittaker commented on August 25, 2024

Captured logcat output as requested. The XDA forum post was very helpful (thanks @jgriffiths), and I ended up doing the following:

  • Enabled 'Developer mode' and 'Debug logging' under Settings (in Calendar Import/Export).
  • Started recording the logcat on my (Linux) laptop with adb logcat -v long > phone.log
  • Used the application as described in the tests below.
  • Ran sed -n '/ICS_/,/^\r$/p' < phone.log > bugtest.log to extract requested sections. (Needed the \r to match "empty" lines, since logcat outputs DOS line endings.)

Test 1: Successfully export a local calendar (id 7, with 30 items):

[ 05-19 20:56:28.939  4563:14208 I/ICS_SaveCalendar ]
Save id 7 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:56:28.955  4563:14208 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

{...then just 29 more copies of this mailTo error...}

Test 2: Trigger bug when exporting a local calendar (id 6):

[ 05-19 20:56:54.025  4563:14223 I/ICS_SaveCalendar ]
Save id 6 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:56:54.041  4563:14223 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

[ 05-19 20:56:54.142  4563:14223 E/ICS_SaveCalendar ]
Failed to create mailTo for organizer mailto:Local Calendar

[ 05-19 20:56:54.142  4563:14223 E/ICS_RunnableWithProgress ]
An exception occurred
java.lang.NullPointerException
        at org.sufficientlysecure.ical.SaveCalendar.getDateTime(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.convertFromDb(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
        at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:856)

Test 3: Trigger same bug when exporting a Google calendar (id 1):

[ 05-19 20:57:13.275  4563:14513 I/ICS_SaveCalendar ]
Save id 1 to file /storage/emulated/0/bugtest.ics

[ 05-19 20:57:16.439  4563:14513 E/ICS_RunnableWithProgress ]
An exception occurred
java.lang.NullPointerException
        at org.sufficientlysecure.ical.SaveCalendar.getDateTime(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.convertFromDb(Unknown Source)
        at org.sufficientlysecure.ical.SaveCalendar.run(Unknown Source)
        at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:856)

I also captured some verbose logcat output with adb logcat -v long '*:v' > phone.log, but this included masses of data, including a dump of each entry read and written, so I've not included it here. I can generate (and sanitize) more of that if it would help.

from calendar-import-export.

pdwhittaker avatar pdwhittaker commented on August 25, 2024

Thanks @Gitoffthelawn for pointing out those. Having now had a closer look, yes, Business Calendar and Business Calendar 2 do both advertise ICS export in their pro versions. Also aCalendar+ (the pro version of aCalendar) mentions "share as ICS" which I suspect is the same, and MyPhoneExplorer looks like it might be able to back calendars up too.

I can also confirm that, as you hinted might be the case, the free aCalendar does not include calendar export (I already had it installed but didn't think to check) and that export is similarly listed as a pro-only feature for Business Calendar and Business Calendar 2.

from calendar-import-export.

Gitoffthelawn avatar Gitoffthelawn commented on August 25, 2024

@pdwhittaker Good info. So all three apps require the pro version for exporting calendars, correct?

If so, here's a trick: Amazon Underground (which is free) has aCalendar+ available for free. To get it, you would install Amazon Underground, and then install aCalendar+. From what I understand, Amazon then will be recording how often you use any app installed through Amazon Underground. Not ideal, but it may be an option for you. You can uninstall everything later.

You also mentioned MyPhoneExplorer. I have never tried it because I think it requires a desktop client to be installed, but I've heard good things about it.

Of course, using the app in this GitHub repo will be ideal for you, but since you need help now and it's not working for you (yet, I'm sure!), maybe one of these other possibilities will meet your immediate needs.

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

@pdwhittaker, great bug report and log, thanks!

As suspected, yours is a different issue and I've raised #42 for it.

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

Whoops, didn't mean to close this. @mzagol I still need your email if you would like me to send this to you for testing.

from calendar-import-export.

mzagol avatar mzagol commented on August 25, 2024

@jgriffiths I sent you an email minutes after you posted your email address. It did not bounce so I assumed it went through. Check spam/junk? Title was 'apk file test'

from calendar-import-export.

jgriffiths avatar jgriffiths commented on August 25, 2024

@mzagol Was in spam folder, doh! debug apk sent, let me know how you get on (here or via email, either works for me).

from calendar-import-export.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.