RedApparat / Fotoapparat

Making Camera for Android more friendly. 📸
Apache License 2.0
3.81k stars 405 forks source link

Kotlin 1.4 update breaks the library's critical functionality #407

Closed miloszkleszczewski closed 3 years ago

miloszkleszczewski commented 3 years ago

With Kotlin's 1.4 update the Fotoapparat's build() function crashes with error:

2020-08-24 10:57:08.883 7440-7440  E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com., PID: 7440
    java.lang.NoClassDefFoundError: Failed resolution of: Lkotlin/coroutines/experimental/CoroutineContext$Element;
        at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:55)
        at io.fotoapparat.Fotoapparat.<init>(Fotoapparat.kt:48)
        at io.fotoapparat.FotoapparatBuilder.buildInternal(FotoapparatBuilder.kt:191)
        at io.fotoapparat.FotoapparatBuilder.build(FotoapparatBuilder.kt:180)

Example code that should allow to reproduce:

    private Fotoapparat createCamera() {
        return Fotoapparat
                .with(getContext())
                .into(cameraView)
                .previewScaleType(ScaleType.CenterCrop)
                .lensPosition(back())
                .build();
    }
AndyAls commented 3 years ago

I have the same problem. Have you solved this problem

miloszkleszczewski commented 3 years ago

@AndyAls I'm positive it's not possible to resolve it without modifying the library itself

WhiteYaksha commented 3 years ago

Same issue here

miloszkleszczewski commented 3 years ago

Version 2.7.0 works correctly