I ran into problems with the `noCompress` option. ...
# multiplatform
h
I ran into problems with the
noCompress
option. I’m trying to load a tensorflow lite model from assets in tests following this standard approach: https://www.tensorflow.org/lite/inference_with_metadata/lite_support Here’s a minimal version of the test that fails:
Copy code
@RunWith(RobolectricTestRunner::class)

class MyTest {
    lateinit var interpreter: Interpreter

    @Before
    fun setUp() {
        val context = InstrumentationRegistry.getInstrumentation().targetContext
        val tfliteModel = FileUtil.loadMappedFile(context, "model.tflite")
        interpreter = Interpreter(tfliteModel)
    }
When I run it, it outputs
java.io.FileNotFoundException: This file can not be opened as a file descriptor; it is probably compressed
. However, I specified this in my gradle.build inside the
android{}
entry:
Copy code
aaptOptions {
        noCompress("tflite")
    }
What could I be doing wrong? P.S. I apologise if this problem is not KMP specific 😅
317 Views