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

26.0-beta2 crashes immediately on start #2224

Closed
kmpoppe opened this issue Nov 1, 2020 · 35 comments
Closed

26.0-beta2 crashes immediately on start #2224

kmpoppe opened this issue Nov 1, 2020 · 35 comments

Comments

@kmpoppe
Copy link
Collaborator

kmpoppe commented Nov 1, 2020

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

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

Kai

@rouelibre1
Copy link

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

@Harvester57
Copy link

Same here (Pocophone F1, Android 10)

@Esternouno
Copy link

Same probkem on Samsung S8+, Android 9

@Lotus815
Copy link

Lotus815 commented Nov 1, 2020

Same for me: Motorola Moto G5 / Android 8.1.0

@westnordost
Copy link
Member

westnordost commented Nov 1, 2020

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)

@KenAlin
Copy link

KenAlin commented Nov 1, 2020

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

@westnordost
Copy link
Member

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)

@westnordost
Copy link
Member

@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

@westnordost
Copy link
Member

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

@Harvester57
Copy link

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

@westnordost
Copy link
Member

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.

@westnordost
Copy link
Member

https://www.westnordost.de/misc/StreetComplete-v26.0-beta3.apk

Will test it myself first

@Harvester57
Copy link

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

@westnordost
Copy link
Member

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

@Lotus815
Copy link

Lotus815 commented Nov 1, 2020

Same for me, beta3 still crashing like beta2

@westnordost
Copy link
Member

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)

@westnordost
Copy link
Member

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

@smichel17
Copy link
Member

smichel17 commented Nov 1, 2020

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.

@westnordost
Copy link
Member

Well I did not update any dependencies

@smichel17
Copy link
Member

smichel17 commented Nov 1, 2020

@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.

@Identitaet
Copy link

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)

@westnordost
Copy link
Member

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

@smichel17
Copy link
Member

smichel17 commented Nov 1, 2020

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.

@westnordost
Copy link
Member

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

@smichel17
Copy link
Member

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.

@RubenKelevra
Copy link
Contributor

RubenKelevra commented Nov 1, 2020

@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.

@westnordost
Copy link
Member

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

@westnordost
Copy link
Member

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?

@matkoniecz
Copy link
Member

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)

@westnordost
Copy link
Member

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

@westnordost
Copy link
Member

westnordost commented Nov 2, 2020

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

@rouelibre1
Copy link

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

@kmpoppe
Copy link
Collaborator Author

kmpoppe commented Nov 2, 2020

Now everything works fine, thanks!

@Harvester57
Copy link

I confirm :)

@matkoniecz
Copy link
Member

Sounds like a fixed bug :)

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