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

ArrayIndexOutOfBoundsException on Android 10 #315

Open
3 tasks done
stoefln opened this issue Feb 24, 2023 · 0 comments
Open
3 tasks done

ArrayIndexOutOfBoundsException on Android 10 #315

stoefln opened this issue Feb 24, 2023 · 0 comments
Assignees
Labels

Comments

@stoefln
Copy link

stoefln commented Feb 24, 2023

Describe the bug

This was working on Android 8, but after the upgrade it's not anymore:

I am getting this stacktrace on a custom device:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
   at android.os.Environment.getExternalStorageState(Environment.java:1026)
   at ch.qos.logback.core.android.AndroidContextUtil.getMountedExternalStorageDirectoryPath(Unknown Source:0)
   at ch.qos.logback.core.android.AndroidContextUtil.setupProperties(Unknown Source:14)
   at ch.qos.logback.classic.util.ContextInitializer.autoConfig(Unknown Source:12)
   at org.slf4j.impl.StaticLoggerBinder.init(Unknown Source:7)
   at org.slf4j.impl.StaticLoggerBinder.<clinit>(Unknown Source:20)
   at org.slf4j.impl.StaticLoggerBinder.getSingleton(Unknown Source:0)
   at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
   at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
   at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:417)
   at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:362)
   at io.devicefarmer.minicap.provider.BaseProvider.<clinit>(BaseProvider.kt:44)
   at io.devicefarmer.minicap.Main$Companion.main(Main.kt:62)
   at io.devicefarmer.minicap.Main.main(Unknown Source:2)
   at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
   at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:338)

This is from my build.gradle:

implementation 'org.slf4j:slf4j-api:1.7.30'
implementation 'com.github.tony19:logback-android:2.0.0'

And here a link to the failing line:
https://github.com/DeviceFarmer/minicap/blob/master/experimental/app/src/main/java/io/devicefarmer/minicap/provider/BaseProvider.kt#L44

Any ideas how we could fix this, or at least handle gracefully?

Reproduction

https://github.com/DeviceFarmer/minicap/blob/master/experimental/

Logs

No response

logback-android version

2.0.0

OS Version

Android 10

What logback configuration are you using? (logback.xml or Java/Kotlin code)

logback.xml

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants