Streetcomplete: 26.0-beta2 crashes immediately on start

Created on 1 Nov 2020  Â·  35Comments  Â·  Source: westnordost/StreetComplete

... unfortunately without any call stack so I cannot provide any insightful stuff.

Samsung M31, installed from APK that's in the release assets.

Kai

Most helpful comment

Invalidate caches & restart, clean build and rebuild didn't change the outputted APK. It remains to be substantially smaller than the "real" one. Next step: Check what's in proguard-android.txt and see if it changed recently

All 35 comments

Same issue on my side (Samsung Galaxy A5 / Android 8.0.0)

Same here (Pocophone F1, Android 10)

Same probkem on Samsung S8+, Android 9

Same for me: Motorola Moto G5 / Android 8.1.0

To get a stack trace would be really helpful, as I wasn't able to reproduce this so far.
What if you delete the data, ist this still reproducible then? (Don't do this if you have unsynced changes to upload, you will lose them)

Same here, on Pixel 4a running Android 11. Here are some screenshots about the error. App data were deleted before start.

Screenshot_20201101-195101_1

Screenshot_20201101-195134_1

I found there have been 62 crashes today with v26.0-beta2 in the google play console:

Problem: There is not even one line from streetcomplete here. Apparently the android system wants to display something, but where?

java.lang.IllegalAccessError: 
  at androidx.appcompat.widget.ContentFrameLayout.onAttachedToWindow (ContentFrameLayout.java:211)
  at android.view.View.dispatchAttachedToWindow (View.java:20479)
  at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3489)
  at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3496)
  at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3496)
  at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3496)
  at android.view.ViewGroup.dispatchAttachedToWindow (ViewGroup.java:3496)
  at android.view.ViewRootImpl.performTraversals (ViewRootImpl.java:2411)
  at android.view.ViewRootImpl.doTraversal (ViewRootImpl.java:1946)
  at android.view.ViewRootImpl$TraversalRunnable.run (ViewRootImpl.java:8156)
  at android.view.Choreographer$CallbackRecord.run (Choreographer.java:972)
  at android.view.Choreographer.doCallbacks (Choreographer.java:796)
  at android.view.Choreographer.doFrame (Choreographer.java:731)
  at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:957)
  at android.os.Handler.handleCallback (Handler.java:938)
  at android.os.Handler.dispatchMessage (Handler.java:99)
  at android.os.Looper.loop (Looper.java:223)
  at android.app.ActivityThread.main (ActivityThread.java:7656)
  at java.lang.reflect.Method.invoke (Method.java)
  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:592)
  at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:947)

@KenAlin Thanks Kevin, so that's the one.

Could someone downgrade to v26.0-beta1 to confirm that the problem does not exist for that version? I am really puzzled because a changed very little between v26.0-beta1 and beta2

Ok, I can reproduce it, but only with the built and signed APK. When I deploy it directly from Android Studio, I can't

I uninstalled the beta2, and reinstalled beta1, works fine here.

Maybe some build problem? I am going to prepare another beta release and post the candidate here, let's see if the problem persists for beta3 without having changed anything really.

Dirty installed it over beta2, still not working. Will try a clean install.

Ok, the link I provided has hte same problem as beta2

Same for me, beta3 still crashing like beta2

I'll rebuilt the beta1 and see if the problem persists, then inch my way forward each commit.

Apparently it is only reproducible with release versions even though there should be no difference between them (other than the debug version is debuggable)

Haha lol, a rebuilt beta1 crashes just the same. What the fuck

Maybe something in the environment changed?

I'm going to spend 20 minutes max doing a quick source dive to see if I can find what the proximate cause of the crash is; maybe that will give a hint about the cause.

Well I did not update any dependencies

@westnordost I assume you've already done a clean rebuild, but can you try wiping anything else that might be cached?

java.lang.IllegalAccessError says,

Normally, this error is caught by the compiler; this error can only occur at run time if the definition of a class has incompatibly changed.

And then, looking at the ContentFrameLayout source, we find that there is not actually anything on line 211, and no changes to that file in almost 3 years.

So, it seems likely to me that some local file was corrupted without the build system realizing it, and re-downloading it would fix the issue.

Edit: might also be proguard.

I have the error from the app in text form
Easier than looking at a screenshot

java.lang.IllegalAccessError: Illegal class access: 'androidx.appcompat.widget.ContentFrameLayout' attempting to access 'androidx.appcompat.app.AppCompatDelegateImpl$5' (declaration of 'androidx.appcompat.widget.ContentFrameLayout' appears in base.apk)
    at androidx.appcompat.widget.ContentFrameLayout.onAttachedToWindow(ContentFrameLayout.java:3)
    at android.view.View.dispatchAttachedToWindow(View.java:19665)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3458)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3465)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3465)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3465)
    at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3465)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2128)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1819)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7781)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1031)
    at android.view.Choreographer.doCallbacks(Choreographer.java:854)
    at android.view.Choreographer.doFrame(Choreographer.java:789)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1016)
    at android.os.Handler.handleCallback(Handler.java:883)
    at android.os.Handler.dispatchMessage(Handler.java:100)
    at android.os.Looper.loop(Looper.java:224)
    at android.app.ActivityThread.main(ActivityThread.java:7562)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)

So the classes.dex of the newly built beta1 is almost 1MB smaller than from the "real" beta1

Assorted other info that may or may not help:

  • The source has an @RestrictTo(LIBRARY) annotation (and an @hide javadoc)

  • There is a ContentFrameLayout.java stub in the regular support library (not androidx) which has no onAttachedToWindow method.

so it looks like proguard/R8 got silently more aggressive without me changing anything. Maybe the proguard-android.txt?

You could try a release build with proguard/R8 disabled and see if that works… Anyway, I'm out of ideas and time I want to spend on this for now, I'll check back later / if anything else occurs to me.

@westnordost I did a perfetto system trace and it looks like android goes into OOM and that's why the app is killed 🤔

I'll poke a bit more around in the trace to see if I can get more out of it.

Just a wild guess:

Maybe some file on your hard drive is corrupted? Try to build it completely from scratch on a different computer.

Invalidate caches & restart, clean build and rebuild didn't change the outputted APK. It remains to be substantially smaller than the "real" one. Next step: Check what's in proguard-android.txt and see if it changed recently

Findings so far:

  • if proguard/R8 is switched off in the build.gradle, the problem is not reproducible. This confirms that it is a problem with proguard.
  • built on a different machine, the problem is not reproducible at all

So it looks like proguard configuration on my main build machine is haywire somehow. Is there even such a thing as a proguard cache that I could clear?

I once has a bizarre build problems and "git push, delete repo, clone repo in a different location" fixed it (sorry if that is not helpful)

On my main build machine, I removed the complete ~/.m2 (local maven repos), ~/.gradle (local gradle stuff, except gradle.properties) and all build and .gradle folders in the project directory and build again. I think it works as normal now. I'm going to post a release candiate in a moment

I am going to upload this version. I tested it on my device, it starts normally. Anyone else wants to try before I release it officially?
https://www.westnordost.de/misc/StreetComplete-v26.0-beta3.apk

No more crash issues on launch for me. Beta 3 solved it.

Now everything works fine, thanks!

I confirm :)

Sounds like a fixed bug :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lzmartinico picture lzmartinico  Â·  4Comments

forteller picture forteller  Â·  3Comments

ecksun picture ecksun  Â·  3Comments

HolgerJeromin picture HolgerJeromin  Â·  3Comments

Helium314 picture Helium314  Â·  3Comments