Unable to build Android app
1337mus opened this issue · 2 comments
1337mus commented
Hi,
I am running in to this issue while running the expo/react native generated Android app I have.
> Duplicate class org.slf4j.impl.StaticLoggerBinder found in modules jetified-logback-android-2.0.0-runtime (com.github.tony19:logback-android:2.0.0) and jetified-slf4j-android-1.7.36 (org.slf4j:slf4j-android:1.7.36)
Duplicate class org.slf4j.impl.StaticMDCBinder found in modules jetified-logback-android-2.0.0-runtime (com.github.tony19:logback-android:2.0.0) and jetified-slf4j-android-1.7.36 (org.slf4j:slf4j-android:1.7.36)
Duplicate class org.slf4j.impl.StaticMarkerBinder found in modules jetified-logback-android-2.0.0-runtime (com.github.tony19:logback-android:2.0.0) and jetified-slf4j-android-1.7.36 (org.slf4j:slf4j-android:1.7.36)
The recommended version per the logback README file seems to be 1.7.36 since 2.x is not supported in gradle?
Seems like adding android.enableJetifier=true
to gradle.properties
file could help?
What would be the best way to resolve this? Thanks for your help in advance.
fdrault commented
Hello,
I can't reproduce your error. Please provide a repository that demonstrates the issue you are reporting
Doing
npx create-expo-app react-native-file-logger-example
cd react-native-file-logger-example
npm install react-native-file-logger
npx expo run:android
Build successfully on my end, even in release mode
1337mus commented
Thanks, This turned out to be unique to my repo. Had to exclude the redundant lib that was getting included by gradle.
Added this to my app/build.gradle
configurations {
all*.exclude module: 'slf4j-android'
}