question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Crash on v2.5.1-RC when scanning testdata vaccination and test certificate

See original GitHub issue

Avoid duplicates

  • Bug is not mentioned in the FAQ
  • Bug is specific for Android only, for general issues / questions that apply to iOS and Android please raise them in the documentation repository
  • Bug is not already reported in another issue

Technical details

  • Device name: Pixel 4a
  • Android version: Android 11
  • App version: 2.5.1-RC (2943eff83e919812f9dffd0df2d6644898fa59e1)

Describe the bug

When scanning the first 2 certificates from this testdata repo: https://github.com/eu-digital-green-certificates/dgc-testdata/tree/main/DE

Then navigating to the PersonDetailsFragment (might need navigating back to PersonOverview before, not sure) the app crashes.

Steps to reproduce the issue

see above

Expected behaviour

No crash.

Possible Fix

Additional context

Log:

07-11 11:21:19.830 31012 31012 E AndroidRuntime: FATAL EXCEPTION: main
07-11 11:21:19.830 31012 31012 E AndroidRuntime: Process: de.rki.coronawarnapp.test, PID: 31012
07-11 11:21:19.830 31012 31012 E AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean androidx.recyclerview.widget.RecyclerView$ViewHolder.shouldIgnore()' on a null object reference
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.recyclerview.widget.RecyclerView.dispatchLayoutStep3(RecyclerView.java:4161)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.recyclerview.widget.RecyclerView.dispatchLayout(RecyclerView.java:3862)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.recyclerview.widget.RecyclerView.onLayout(RecyclerView.java:4404)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.google.android.material.appbar.HeaderScrollingViewBehavior.layoutChild(HeaderScrollingViewBehavior.java:148)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.google.android.material.appbar.ViewOffsetBehavior.onLayoutChild(ViewOffsetBehavior.java:43)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.google.android.material.appbar.AppBarLayout$ScrollingViewBehavior.onLayoutChild(AppBarLayout.java:2003)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:918)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.constraintlayout.widget.ConstraintLayout.onLayout(ConstraintLayout.java:1855)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.coordinatorlayout.widget.CoordinatorLayout.layoutChild(CoordinatorLayout.java:1213)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayoutChild(CoordinatorLayout.java:899)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at androidx.coordinatorlayout.widget.CoordinatorLayout.onLayout(CoordinatorLayout.java:919)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1829)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1673)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.LinearLayout.onLayout(LinearLayout.java:1582)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.layoutChildren(FrameLayout.java:332)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.widget.FrameLayout.onLayout(FrameLayout.java:270)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.android.internal.policy.DecorView.onLayout(DecorView.java:784)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.View.layout(View.java:22844)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewGroup.layout(ViewGroup.java:6389)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewRootImpl.performLayout(ViewRootImpl.java:3475)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2943)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1948)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8177)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:972)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.Choreographer.doCallbacks(Choreographer.java:796)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.Choreographer.doFrame(Choreographer.java:731)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:223)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7664)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
07-11 11:21:19.830 31012 31012 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)

EXPOSUREAPP-8336

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:5
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

3reactions
MikeMcC399commented, Jul 11, 2021

@Bubu Nice catch! I can reproduce this on Android 8

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: de.rki.coronawarnapp.test, PID: 25075
    java.lang.IllegalStateException: Two different ViewHolders have the same stable ID. Stable IDs in your adapter MUST BE unique and SHOULD NOT change.
     ViewHolder 1:VaccinationCertificateCard{b67a9ab position=3 id=346916434, oldPos=-1, pLpos:-1} 
     View Holder 2:TestCertificateCard{1f044f2 position=2 id=346916434, oldPos=-1, pLpos:-1} androidx.recyclerview.widget.RecyclerView{a5ce9c7 VFED..... .F....ID 0,168-1080,1812 #7f0a059f app:id/recycler_view_certificates_list}, adapter:de.rki.coronawarnapp.covidcertificate.person.ui.details.PersonDetailsAdapter@73c04e, layout:androidx.recyclerview.widget.LinearLayoutManager@34d56f, context:de.rki.coronawarnapp.ui.main.MainActivity@25c099a

Steps to reproduce

  1. Tap “Certificates”
  2. Tap “ADD CERTIFICATE”
  3. From page https://github.com/eu-digital-green-certificates/dgc-testdata/tree/main/DE scan vaccination certificate (1)
  4. Tap back arrow, tap X
  5. Tap “ADD CERTIFICATE”
  6. From page above scan test certificate (2)
  7. Tap back arrow
  8. Scroll down and tap Vaccination Certificate card at bottom
  9. Tap back arrow
  10. App crashes
1reaction
d4rkencommented, Jul 11, 2021

@vaubaehn’s 👃 is correct. This will be fixed by #3680: Two certificate having the same certificateId and the RecyclerView optimizations require stableId = certificateId to be unique.

Any way to get this into 2.5.x, @harambasicluka and @d4rken ?

We had discussed this and decided against it as the certificate IDs “should” be unique, it does not warrant cutting another RC for 2.5.x and delay its release.

It’s a bit unfortunate that the demo certificates re-use the same ID, especially for vaccination certificate chains, which @fynngodau previously raised already.

I think iOS currently prevents adding certificates with the same ID? Due to differences in storage, Android only checks the IDs per certificate-type.

We are evaluating to check the certificateId against all types on Android too, and preventing adding them if there is a collision. Though this is kinda a catch22: If the IDs are in practice not as unique as they should be, then “valid” certificates with duplicate IDs have been issued… when this happened with the date stuff, the checks were relaxed…

In theory they should be unique, in practice 🤷 :

It is the Member states’ responsibility to come up with the mechanism for generating and indexing the forementioned single unique vaccination identifiers.

@Bubu DDOS case is an interesting point too. It should be fixed by #3680 too, other logic across certificates types doesn’t rely on the certificateId being unique.

Read more comments on GitHub >

github_iconTop Results From Across the Web

COVID-19 Negative Test Result Certificate before departure ...
From October 11, 2022, all returnees and entrants are required to show either a valid COVID-19 vaccination certificate of three doses of vaccines...
Read more >
COVID Certificates: common problems and solutions
You can generate a COVID certificate (QR code) in the CoronaCheck app or on ... been infected with coronavirus, see the information on...
Read more >
Download health records on iPhone - Apple Support
You can securely download verifiable COVID-19 vaccination and test result records and store them in the ... Use your iPhone camera to scan...
Read more >
Verifying Proof of COVID-19 Vaccination
CDPH Digital. Vaccination record after being scanned by the SMART. Health Card Verifier. App. Healthvana. CDC Vaccination Record Card. 9/30/21 ...
Read more >
COVID-19 Information - SCAN Health Plan!
We will continue to update this page with information about the COVID-19 vaccine, testing and care. In the meantime, please contact your ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found