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

Getting crash reports in the release version of the android app #116

Closed
ankitbatra11 opened this issue Aug 11, 2021 · 4 comments
Closed

Comments

@ankitbatra11
Copy link

Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'int java.io.Reader.read(char[])' on a null object reference
       at java.util.Properties$LineReader.readLine(Properties.java:432)
       at java.util.Properties.load0(Properties.java:348)
       at java.util.Properties.load(Properties.java:336)
       at ezvcard.Ezvcard.<clinit>(Ezvcard.java:127)
       at ezvcard.Ezvcard.write(Ezvcard.java:16)
       at ezvcard.VCard.write(VCard.java:166)
@ankitbatra11
Copy link
Author

ankitbatra11 commented Aug 11, 2021

Looks like in is still null even after in = Ezvcard.class.getResourceAsStream("ez-vcard.properties"); line 126 in Ezvcard.java.

Debug version of the android app works fine. This issue is observed only in the release version of the app. Not sure why getResourceAsStream would not find the file only in the release version of the app.

Is there an android compatible version of this library available?

@mangstadt
Copy link
Owner

Several other people have reported the same issue. It appears to be related to Proguard. Unfortunately, I am not familiar with Android, so I can't provide any more details.

I recommend checking out the threads below. They include several solutions to the problem. Please let me know if you find a solution.

@rfc2822
Copy link
Contributor

rfc2822 commented Aug 12, 2021

DAVx5 uses vcard4android, which uses ez-vcard too. Works perfectly for release builds. You can find its ProGuard rules here: https://gitlab.com/bitfireAT/davx5-ose/-/blob/dev-3.x-ose/app/proguard-rules-release.pro

mangstadt added a commit that referenced this issue Sep 11, 2021
This resolves a frequently-reported Android issue where the properties
file can't be found on the classpath.

#116
@mangstadt
Copy link
Owner

In the latest ez-vcard release (0.11.3), I removed this .properties file completely, since so many people have reported having issues with it.

The file was largely unnecessary, as most of the information in the file rarely changes. Removing the file is also better from a performance perspective, as it removes the need to perform file I/O.

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

3 participants