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

Migrate from Hilt (Dagger2) to Koin for Dependency Injection #11

Closed
shubham0204 opened this issue Oct 18, 2024 · 4 comments · Fixed by #12
Closed

Migrate from Hilt (Dagger2) to Koin for Dependency Injection #11

shubham0204 opened this issue Oct 18, 2024 · 4 comments · Fixed by #12
Assignees
Labels
enhancement New feature or request

Comments

@shubham0204
Copy link
Owner

Due to issues #4 originating from Hilt, the project is now being migrated to Koin.
Koin is a light-weight DI framework written in Kotlin, and has been adopted by the developer community widely.

References

@shubham0204 shubham0204 self-assigned this Oct 18, 2024
@shubham0204 shubham0204 added the enhancement New feature or request label Oct 18, 2024
@shubham0204 shubham0204 linked a pull request Oct 18, 2024 that will close this issue
@dcrowleyMunster
Copy link

This code compiles however once run, the following error happens where the generated files are not in the expected directory structure?

Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.ml.shubham0204.docqa-DqcFSrNN4B3M38jFa8DzAA==/lib/x86/libhftokenizer.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at com.ml.shubham0204.sentence_embeddings.HFTokenizer.(HFTokenizer.kt:51)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invokeSuspend(SentenceEmbedding.kt:24) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:8) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:4) 
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) 
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) 
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init(SentenceEmbedding.kt:23) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init$default(SentenceEmbedding.kt:18) 
at com.ml.shubham0204.docqa.domain.embeddings.SentenceEmbeddingProvider$1.invokeSuspend(SentenceEmbeddingProvider.kt:18) 
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) 
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) 
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 

Longer error output

024-10-18 13:37:11.270 16523-16591 ubham0204.docq com.ml.shubham0204.docqa I at void kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run() (CoroutineScheduler.kt:684)
2024-10-18 13:37:11.270 16523-16591 ubham0204.docq com.ml.shubham0204.docqa I
2024-10-18 13:37:11.271 16523-16523 AndroidRuntime com.ml.shubham0204.docqa D Shutting down VM
2024-10-18 13:37:11.271 16523-16523 AndroidRuntime com.ml.shubham0204.docqa E FATAL EXCEPTION: main
Process: com.ml.shubham0204.docqa, PID: 16523
java.lang.NoClassDefFoundError: com.ml.shubham0204.sentence_embeddings.HFTokenizer
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invokeSuspend(SentenceEmbedding.kt:24)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:8)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:4)
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78)
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167)
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init(SentenceEmbedding.kt:23)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init$default(SentenceEmbedding.kt:18)
at com.ml.shubham0204.docqa.domain.embeddings.SentenceEmbeddingProvider$1.invokeSuspend(SentenceEmbeddingProvider.kt:18)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Caused by: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_Unwind_Resume" referenced by "/data/app/com.ml.shubham0204.docqa-DqcFSrNN4B3M38jFa8DzAA==/lib/x86/libhftokenizer.so"...
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at com.ml.shubham0204.sentence_embeddings.HFTokenizer.(HFTokenizer.kt:51)
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invokeSuspend(SentenceEmbedding.kt:24) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:8) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding$init$2.invoke(Unknown Source:4) 
at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:78) 
at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:167) 
at kotlinx.coroutines.BuildersKt.withContext(Unknown Source:1) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init(SentenceEmbedding.kt:23) 
at com.ml.shubham0204.sentence_embeddings.SentenceEmbedding.init$default(SentenceEmbedding.kt:18) 
at com.ml.shubham0204.docqa.domain.embeddings.SentenceEmbeddingProvider$1.invokeSuspend(SentenceEmbeddingProvider.kt:18) 
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) 
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) 
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) 
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) 
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) 
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684) 
2024-10-18 13:37:11.279 16523-16523 Process com.ml.shubham0204.docqa I Sending signal. PID: 16523 SIG: 9
2024-10-18 13:37:11.328 1996-2087 InputDispatcher system_server E channel 'b33a08e com.ml.shubham0204.docqa/com.ml.shubham0204.docqa.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!

@dcrowleyMunster
Copy link

It might be that installing Oboe 1.4.3 might solve the issue of not finding the symbol in the error output

@shubham0204
Copy link
Owner Author

This is a known issue shubham0204/Sentence-Embeddings-Android#1 on the Sentence-Embeddings-Android repository. The library cannot be used in apps that run on x86-64 Android (emulators).

I suggest that you try running the app on an Android mobile device (ARM-based).

@dcrowleyMunster
Copy link

yep. the Docs-QA pops up when an android is connected. Well done and thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants