streetcomplete / StreetComplete

Easy to use OpenStreetMap editor for Android
https://streetcomplete.app
GNU General Public License v3.0
3.85k stars 352 forks source link

Crash at app start #2006

Closed hontogit closed 4 years ago

hontogit commented 4 years ago

I just updated SC from version 21.2 to 22.0 from f-droid. When I open the app it immediately crashes. This is what I got as information with logcat

[08-10 12:39:11.114 7539:7582 E/AndroidRuntime]
FATAL EXCEPTION: DefaultDispatcher-worker-2
Process: de.westnordost.streetcomplete, PID: 7539
java.lang.IllegalAccessError: Field 'org.apache.commons.codec.binary.Base64.lookUpBase64Alphabet' is inaccessible to class 'oauth.signpost.signature.HmacSha1MessageSigner' (declaration of 'oauth.signpost.signature.HmacSha1MessageSigner' appears in /data/app/de.westnordost.streetcomplete-1/base.apk)
    at oauth.signpost.signature.HmacSha1MessageSigner.base64Encode(HmacSha1MessageSigner.java:9)
    at oauth.signpost.signature.HmacSha1MessageSigner.sign(HmacSha1MessageSigner.java:13)
    at oauth.signpost.basic.DefaultOAuthConsumer.sign(DefaultOAuthConsumer.java:22)
    at de.westnordost.osmapi.OsmConnection.sendRequest(OsmConnection.java:22)
    at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:2)
    at de.westnordost.osmapi.OsmConnection.makeAuthenticatedRequest(OsmConnection.java:1)
    at de.westnordost.streetcomplete.data.user.UserController$updateUser$1.invokeSuspend(UserController.kt:5)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:15)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:1)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:11)

[08-10 12:39:11.117 1825:2312 W/ActivityManager]
  Force finishing activity de.westnordost.streetcomplete/.MainActivity

How to Reproduce Start the App

Versions affected Android 7.1.2 StreetComplete 22.0

Hawaiihemd commented 4 years ago

I second that. Same exception here.

08-10 14:05:53.787 29169 29203 E AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-2 08-10 14:05:53.787 29169 29203 E AndroidRuntime: Process: de.westnordost.streetcomplete, PID: 29169 08-10 14:05:53.787 29169 29203 E AndroidRuntime: java.lang.IllegalAccessError: Field 'org.apache.commons.codec.binary.Base64.lookUpBase64Alphabet' is inaccessible to class 'oauth.signpost.signature.HmacSha1MessageSigner' (declaration of 'oauth.signpost.signature.HmacSha1MessageSigner' appears in /data/app/de.westnordost.streetcomplete-7YOBgzL0OVnSef9dYSafQg==/base.apk) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at oauth.signpost.signature.HmacSha1MessageSigner.base64Encode(HmacSha1MessageSigner.java:9) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at oauth.signpost.signature.HmacSha1MessageSigner.sign(HmacSha1MessageSigner.java:13) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at oauth.signpost.basic.DefaultOAuthConsumer.sign(DefaultOAuthConsumer.java:22) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at de.westnordost.osmapi.OsmConnection.sendRequest(OsmConnection.java:22) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at de.westnordost.osmapi.OsmConnection.makeRequest(OsmConnection.java:2) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at de.westnordost.osmapi.OsmConnection.makeAuthenticatedRequest(OsmConnection.java:1) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at de.westnordost.streetcomplete.data.user.UserController$updateUser$1.invokeSuspend(UserController.kt:5) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:2) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:15) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:1) 08-10 14:05:53.787 29169 29203 E AndroidRuntime: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:11)

Android 8.1.0 StreetComplete 22.0

westnordost commented 4 years ago

Yes, I am getting a lot of crash reports since yesterday or so. Something must have changed in ... I don't know ... I did not update any dependencies I know of, maybe the Android platform?? Anyway, it looks like the OAuth signpost library issued an update that seems to workaround this issue so I just need to update osmapi to the new major version:

https://github.com/mttkay/signpost/releases