Hi,
We have just install a Nextcloud Server to change our owncloud solution but when using the last nextcloud playstore version on a samsung android tablet (android 7) the application stopped while opening or scrolling over a PDF file. Same issue with a samsung android phone. Can't check the Log as you removed the expert mode. So I tried to take an older APK : nextcloud-30020199.apk and it's working fine with it. Could you please tell us if it's a known problem which will be fixed because we will have a lot of android with nextcloud using google MDM to deploy and we can't do it with an old APK... Attached the error when application stop (in french sorry)
Best Regards

Is this happening only on the first time you try to open a pdf?
Can you provide us additional infos via logcat? https://github.com/nextcloud/android/blob/master/README.md#getting-debug-info-via-logcat
Hello,
no it always happend then nextcloud crash and need to stop. The pdf could open and then application stop few seconds later but if i select a pdf file but i don't chose the application to open with and wait few second the same error happend .. At the beginning i was thinking the problem come from the pdf app but i tried with different one and same problem :(
please find attaches the log but sorry its a full part log as grep command not working on my windows 10 maybe you can find what you want.
Thanks a lot for your help
log.txt
Hello, thanks for your help, so is it a nextcloud bug that will be fixed or do we have something to do from our side?
Thanks
Best Regards
@ezaquarii do you have in idea how to fix this?
Missing parts on dex list sounds very strange to me…
Yes, it looks like it tries to call platform API level 28 down the road: android.view.ViewCompat$OnUnhandledKeyEventListenerWrapper
@Handoz49 run it on Android 7, so this class does not exist in runtime and class loader complains - of course.
Maybe there is some issue reported by google or there are some API-level specific instructions we should follow when integrating androidx, like theme attributes or something?
I'd rule out dead code elimination here, as the missing class is clearly in Android core framework that ships with the phone OS.
Hard to say what happened without doing git bisect on latest changes, but he user provided a version that works for him. I can't decipher the version number - nextcloud-30020199.apk. Rings any bell?
@Handoz49, did you try on any other Android 7 device?
I did it on my Samsung s7 which is on Android 8 had the same problem
@ezaquarii , I can try on other android 7.0 tomorrow but it will be the same model
Thanks. No need to do more test for now. We have pretty good idea what's the immediate cause. Cheers.
On May 14, 2019 8:22:46 PM UTC, Handoz49 notifications@github.com wrote:
@ezaquarii , I can try on other android 7.0 tomorrow but it will be the
same model--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
https://github.com/nextcloud/android/issues/3994#issuecomment-492395187
The referenced version code is release 3.2.1 final build. That version is quite old and long before we migrated to AndroidX... :/
Same problem in google samples:
https://github.com/googlesamples/android-sunflower/issues/295
Relevant google issue:
https://issuetracker.google.com/issues/120750246
Here I found a possible workaround
https://issuetracker.google.com/issues/120750246#comment11
Whomever re-opened this issue, thank you! Stuck on API 27 because of this :(
More options we can consider:
Hmm, can this than be a blocker for the dark theme branch (running on 1.1.0 alpha lib releases) also since GPlay demands latest compile targets within a certain time frame is a target downgrade an option?
Also cc @tobiasKaminsky for opinions.
https://developer.android.com/distribute/best-practices/develop/target-sdk
It looks like it's ok until November 2019 to stick to 27, hoping that they will fix AndroidX.
Then I think downgrade would be fine for now.
What do you think @tobiasKaminsky?
@tobiasKaminsky @AndyScherzinger @Handoz49
Full stop. My initial investigation was totally wrong. My bad.
The stacktrace was actually just a warning, not a crash. I was too fast to jump into conclusions, so let's forget about it.
The true crash is hidden here:
05-10 16:01:25.129 27435 27435 D AndroidRuntime: Shutting down VM
05-10 16:01:25.130 27435 27435 E AndroidRuntime: FATAL EXCEPTION: main
05-10 16:01:25.130 27435 27435 E AndroidRuntime: Process: com.nextcloud.client, PID: 27435
05-10 16:01:25.130 27435 27435 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke interface method 'boolean com.owncloud.android.utils.DisplayUtils$AvatarGenerationListener.shouldCallGeneratedCallback(java.lang.String, java.lang.Object)' on a null object reference
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at com.owncloud.android.datamodel.ThumbnailsCacheManager$AvatarGenerationTask.onPostExecute(ThumbnailsCacheManager.java:841)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at com.owncloud.android.datamodel.ThumbnailsCacheManager$AvatarGenerationTask.onPostExecute(ThumbnailsCacheManager.java:789)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.os.AsyncTask.finish(AsyncTask.java:660)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.os.AsyncTask.-wrap1(AsyncTask.java)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:677)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.os.Looper.loop(Looper.java:154)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6780)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1500)
05-10 16:01:25.130 27435 27435 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1390)
Looks like an NPE in our own code.
protected void onPostExecute(Drawable drawable) {
if (drawable != null) {
AvatarGenerationListener listener = mAvatarGenerationListener.get();
AvatarGenerationTask avatarWorkerTask = getAvatarWorkerTask(mCallContext);
if (this == avatarWorkerTask && listener.shouldCallGeneratedCallback(mUserId, mCallContext)) {
listener.avatarGenerated(drawable, mCallContext);
}
}
}
mAvatarGenerationListener is a weak reference and as such can be null. We don't check for it at all. Easy-peasy.
@Handoz49 Could you pls install the APK available here: https://github.com/nextcloud/android/pull/4041
and see if that fixed the problem? Just scan the QR code or use the URL.
No need to uninstall - we're using a separate app package to allow parallel installations of QA and whatever other version of Nextcloud you have installed.
@ezaquarii I will try tomorrow at work thanks
@ezaquarii @AndyScherzinger @tobiasKaminsky
Hello, just tried the new APK (9254.apk), looks like it works for PDF, I had one crash but not while checking pdf files and so i tried again for 5 minutes and it did'nt crashed again, maybe bad luck
@ezaquarii I think the crash above come from nextcloud which reinstall because of the MDM strategy while i was using the QA version
Nice @ezaquarii!
Thanks for finding the real cause and fixing it :tada:
will this fix include in the next nexcloud update on the playstore? if yes how many times do you think it will take to have it? thanks a lot best regards
I will release a RC1 of upcoming version today, which can be get via beta program on gplay.
Final will be ~Thursday.
Final release 3.6.2 has been published today so it should be available on Google Play very soon and wihtin some days via f-droid too.
Most helpful comment
mAvatarGenerationListeneris a weak reference and as such can be null. We don't check for it at all. Easy-peasy.