Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when importing ics file exported from calendar-import-export #94

Open
red-black-bonsai opened this issue Mar 24, 2022 · 18 comments
Open

Comments

@red-black-bonsai
Copy link

red-black-bonsai commented Mar 24, 2022

To migrate the local calendar from phone A to phone B, I created an export with CIE on phone A, copied the ics to phone B and tried importing. CIE, version 2.7, just closes/crashes.

Installing CIE version 2.6 from F-Droid store (after first uninstalling version 2.7) on phone B alleviates the problem. With it, I can import fine (even a file generated by 2.7 on phone A) :)

Potentially relevant log from import on phone B:

03-24 18:49:14.269 22905 22934 E AndroidRuntime: FATAL EXCEPTION: Thread-3
03-24 18:49:14.269 22905 22934 E AndroidRuntime: Process: org.sufficientlysecure.ical, PID: 22905
03-24 18:49:14.269 22905 22934 E AndroidRuntime: java.lang.ExceptionInInitializerError
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at net.fortuna.ical4j.util.Configurator.getProperty(Unknown Source:0)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at net.fortuna.ical4j.util.CompatibilityHints.<clinit>(Unknown Source:9)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at net.fortuna.ical4j.util.CompatibilityHints.setHintEnabled(Unknown Source:0)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.sufficientlysecure.ical.ui.MainActivity$LoadFile.setHint(Unknown Source:0)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.sufficientlysecure.ical.ui.MainActivity$LoadFile.run(Unknown Source:12)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source:2)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:923)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: Caused by: org.apache.commons.logging.LogConfigurationException: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.impl.LogFactoryImpl" on path: DexPathList[[zip file "/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/base.apk"],nativeLibraryDirectories=[/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/lib/arm64, /system/lib64, /system_ext/lib64]] (Caused by java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.impl.LogFactoryImpl" on path: DexPathList[[zip file "/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/base.apk"],nativeLibraryDirectories=[/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/lib/arm64, /system/lib64, /system_ext/lib64]])
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory.createFactory(Unknown Source:459)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory$2.run(Unknown Source:4)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at java.security.AccessController.doPrivileged(AccessController.java:43)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory.newFactory(Unknown Source:5)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory.getFactory(Unknown Source:487)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory.getLog(Unknown Source:0)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at net.fortuna.ical4j.util.Configurator.<clinit>(Unknown Source:20)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	... 7 more
03-24 18:49:14.269 22905 22934 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.logging.impl.LogFactoryImpl" on path: DexPathList[[zip file "/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/base.apk"],nativeLibraryDirectories=[/data/app/~~F1kOHNBP-ITQYlfyjUJwlQ==/org.sufficientlysecure.ical-voKQx_iG8O0BI950MvAZ8w==/lib/arm64, /system/lib64, /system_ext/lib64]]
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	at org.apache.commons.logging.LogFactory.createFactory(Unknown Source:5)
03-24 18:49:14.269 22905 22934 E AndroidRuntime: 	... 13 more
03-24 18:49:14.276  1391 10670 W ActivityTaskManager:   Force finishing activity org.sufficientlysecure.ical/.ui.MainActivity

If I disable permissive export on phone A, I also get this error in phone A's log:

03-24 18:39:33.328  8934 20369 I ICS_SaveCalendar: END:VEVENT
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: An exception occurred
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: net.fortuna.ical4j.model.ValidationException: Property [ORGANIZER] must be specified once
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.util.PropertyValidator.assertOne()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.model.component.VEvent$PublishValidator.validate()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.model.component.CalendarComponent.validate()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.model.Calendar.validate()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.model.Calendar.validate()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.data.CalendarOutputter.output()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at net.fortuna.ical4j.data.CalendarOutputter.output()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at org.sufficientlysecure.ical.SaveCalendar.run()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run()
03-24 18:39:33.339  8934 20369 E ICS_RunnableWithProgress: 	at java.lang.Thread.run(Thread.java:761)
@thewholelifetolearn
Copy link

I encounter the same issue after updating to v2.7. The app crashed when opening a file. After uninstalling and reinstalling, the app opened but crashed when charging the ics file.
I'm on android 12.

@sail2themoon
Copy link

Hi, same crash for me with 2.7 - thank you very much, red-black-bonsai for telling us, that version 2.6, manually chosen in f-droid, is working fine, so it does for me.

@fhaftmann
Copy link
Contributor

Thanks for reporting this.

The work-around 58b337c works reproducibly for me so I branded a new release which should be available on F-Droid within a few days.

@fhaftmann
Copy link
Contributor

There is now a release 2.7.1 available at https://f-droid.org/en/packages/org.sufficientlysecure.ical/ – please check whether this resolves the issue you experience.

@thewholelifetolearn
Copy link

I have tried 2.7.1 version but it didn't change anything. It still crashes when opening a file. I had to return to 2.6.0

@skylarmt
Copy link

I'm having crashes on 2.7.2 still with importing calendar files. I open the ICS from my email app and as soon as I press Load in this app it crashes.

@skylarmt
Copy link

Here's an ICS file that causes a crash. I changed the file extension so GitHub would upload it.
sample-crashes-2.7.2.txt

@thewholelifetolearn
Copy link

I confirm @skylarmt comment. It doesn't work either with the 2.7.2 version. This time it crashes when loading the ICS file. I can't downgrade to 2.6.0 anymore because FDroid shows only the last 3 versions :(. Is it possible to to download the apk files through Github?

@fhaftmann
Copy link
Contributor

I can reproduce the error: it occurs during the static initialization of net.fortuna.ical4j.util.Configurator.

Applying the work-arodung suggest in https://stackoverflow.com/questions/60018008/android-apache-logger-crashes-for-no-reason-in-production-release-build helps, see 1b3ab38.

A new release is schedule, stay tuned.

@k-svn
Copy link

k-svn commented Apr 22, 2022

Unfortunately, version 2.7.4 is even worse than 2.7.2. In the last version the app crashed when selecting an ics import file. Now it already crashes when you just click on "import file"...

@kusalux
Copy link

kusalux commented Apr 24, 2022

Can confirm worse behavior - crash on "import file" with 2.7.4. With clean installed A12L (5.April 22 Patch) Rom.

@fhaftmann
Copy link
Contributor

Unfortunately, I cannot reproduce the issue, using android emulator with Android 12.0 / API 31 / x86_64.

Since the crash is reported to happen when clicking »import file«, the exact content of the file should be irrelevant. There must be subtle differences with the setup.

Actually, there have been a lot of participants in this thread. Are there any among you who get along with 2.7.4? This could give important clues what goes wrong here.

@skylarmt
Copy link

skylarmt commented Apr 27, 2022

Android 12.0 / API 31 / x86_64

I'm running 2.7.4 from F-Droid. My device is Android 11 (LineageOS 18.1) on ARM64, no GApps.

Here's my logcat when I press Import File:

E AndroidRuntime: java.lang.VerifyError: Verifier rejected class org.sufficientlysecure.ical.ui.MainActivity$CalendarSource:  
    java.net.URLConnection org.sufficientlysecure.ical.ui.MainActivity$CalendarSource.getConnection() failed to verify:  
    java.net.URLConnection org.sufficientlysecure.ical.ui.MainActivity$CalendarSource.getConnection():  
    [0x50] 'this' argument 'Precise Reference: org.apache.commons.codec.binary.Base64' not instance of  
    'Reference: org.apache.commons.codec.binary.BaseNCodec' (declaration of 'org.sufficientlysecure.ical.ui.MainActivity$CalendarSource' appears in base.apk)
E AndroidRuntime:        at org.sufficientlysecure.ical.ui.MainActivity$SearchForFiles.search(Unknown Source:53)
E AndroidRuntime:        at org.sufficientlysecure.ical.ui.MainActivity$SearchForFiles.search(Unknown Source:20)
E AndroidRuntime:        at org.sufficientlysecure.ical.ui.MainActivity$SearchForFiles.run(Unknown Source:27)
E AndroidRuntime:        at org.sufficientlysecure.ical.ui.dialogs.RunnableWithProgress$1.run(Unknown Source:2)
W ActivityTaskManager:   Force finishing activity org.sufficientlysecure.ical/.ui.MainActivity

@fhaftmann
Copy link
Contributor

I cannot reproduce the behaviour, but the log clearly points to the line changed in a23e732

There are hints that the Android framework uses a fixed version of the Commons Codec library, cf. https://stackoverflow.com/questions/9126567/method-not-found-using-digestutils-in-android/29833101#29833101

Speculatively it is better to avoid to rely on inheritance here, maybe that plain static method call works better.

If this doesn't help either, I plan to go with https://github.com/ExCiteS/apache-commons-codec-shaded and include a whole clone of Commons Codec.

@kusalux
Copy link

kusalux commented May 4, 2022

Many thanks. Sry, just had time to test now but it does work with 2.7.5, could import without errors. 😃

@k-svn
Copy link

k-svn commented May 4, 2022

Well done! Import with 2.7.5 works fine again! Thanks you 👍🏻

@skylarmt
Copy link

skylarmt commented May 5, 2022

2.7.5 works for me too.

@thewholelifetolearn
Copy link

2.7.5 works for me too but when I open a file, then load it, I have two instances of the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants