Fitbit / bitgatt

The FitbitGatt API is designed to provide a strong state machine around all Android gatt operations with the aim of making Android BLE development across Android vendors as straightforward and side-effect free as possible.
Mozilla Public License 2.0
57 stars 17 forks source link

Do not require Timber. #42

Open NathanRussak opened 3 years ago

NathanRussak commented 3 years ago

Is your feature request related to a problem? Please describe. If an app adds com.github.Fitbit:bitgatt as a dependency but does NOT add timber it will crash as soon as FitbitGatt attempts to setup.

Example build.gradle:

dependencies {
    implementation 'com.github.Fitbit:bitgatt:0.9.2-RC4'
    // No timber!
    ...
}

Example Crash:

2021-02-08 23:10:56.813 18446-18446/com.myapp.demo.debug E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.myapp.demo.debug, PID: 18446
    java.lang.NoClassDefFoundError: Failed resolution of: Ltimber/log/Timber;
        at com.fitbit.bluetooth.fbgatt.FitbitGatt.setup(FitbitGatt.java:161)
        at com.fitbit.bluetooth.fbgatt.FitbitGatt.getInstance(FitbitGatt.java:146)
        ...
     Caused by: java.lang.ClassNotFoundException: Didn't find class "timber.log.Timber" on path: DexPathList[[zip file "/data/app/~~buWpUy0wluCeKRNDidVUzA==/com.myapp.demo.debug-Zm3_EyFVTFzsRcNbP_PGQg==/base.apk"],nativeLibraryDirectories=[/data/app/~~buWpUy0wluCeKRNDidVUzA==/com.myapp.demo.debug-Zm3_EyFVTFzsRcNbP_PGQg==/lib/arm64, /system/lib64, /system_ext/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:207)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at com.fitbit.bluetooth.fbgatt.FitbitGatt.setup(FitbitGatt.java:161) 
        at com.fitbit.bluetooth.fbgatt.FitbitGatt.getInstance(FitbitGatt.java:146) 
        ...

Describe the solution you'd like Timber is a great logging library but, if it isn't too much trouble, it would be nice to not REQUIRE all apps that use FitbitGatt to also use Timber.

Describe alternatives you've considered N/A

Additional context N/A