Error - Please provide the required library data via the available APIs.
Abhimanyu14 opened this issue · 6 comments
About this issue
I am trying to use this library.
I am getting this error
Please provide the required library data via the available APIs.
Complete Error
java.lang.IllegalStateException: Please provide the required library data via the available APIs.
Depending on the platform this can be done for example viaLibsBuilder().withJson()
.
For Android there exists anLibsBuilder.withContext()
, automatically loading theaboutlibraries.json
file from theraw
resources folder.
When using compose or other parent modules, please check their corresponding APIs.
at com.mikepenz.aboutlibraries.Libs$Builder.build(Libs.kt:37)
at com.mikepenz.aboutlibraries.ui.compose.LibrariesKt$LibrariesContainer$1.invoke(Libraries.kt:47)
at com.mikepenz.aboutlibraries.ui.compose.LibrariesKt$LibrariesContainer$1.invoke(Libraries.kt:46)
at com.mikepenz.aboutlibraries.ui.compose.LibrariesKt$LibrariesContainer$libraries$1$1.invokeSuspend(Libraries.kt:64)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
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)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@2315a00, androidx.compose.runtime.BroadcastFrameClock@46f8239, StandaloneCoroutine{Cancelling}@e3e007e, AndroidUiDispatcher@400c9df]
Code used (Copied from the library app module)
LibrariesContainer(
Modifier
.fillMaxSize()
.padding(),
contentPadding = WindowInsets.navigationBars.asPaddingValues(),
showAuthor = true,
showVersion = true,
showLicenseBadges = true,
header = {
stickyHeader {
Column(
modifier = Modifier
.fillMaxWidth()
.padding(vertical = 25.dp),
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text("ExampleHeader")
}
}
}
)
- Briefly describe the issue
- How can the issue be reproduced / sample code
Details
- Used library version
- Used support library version
- Used gradle build tools version
- Used tooling / Android Studio version
- Other used libraries, potential conflicting libraries
Checklist
- Searched for similar issues
- Checked out the sample application
- Read the README
- Checked out the CHANGELOG
- Read the MIGRATION GUIDE
On which platform are you trying to use it?
Android or on a different platform?
Is the gradle plugin correctly applied to the module?
Do you see the generated data by the plugin in: build/generated/aboutLibraries
?
Platform : Android
libs.versions.toml
[versions]
about-libraries = "10.8.3"
[libraries]
#about libraries
about-libraries-core = { group = "com.mikepenz", name = "aboutlibraries-core", version.ref = "about-libraries" }
about-libraries-compose = { group = "com.mikepenz", name = "aboutlibraries-compose", version.ref = "about-libraries" }
[plugins]
about-libraries = { id = "com.mikepenz.aboutlibraries.plugin", version.ref = "oss-licenses" }
Project build.gradle
plugins {
alias libs.plugins.about.libraries
}
Feature build.gradle
dependencies {
// About libraries
implementation libs.about.libraries.core
implementation libs.about.libraries.compose
}
Project repo link - https://github.com/Abhimanyu14/finance-manager
I don't find a build/generated/aboutLibraries
package.
Will try adding the dependency in app
module as well to see if that is required.
Looks your app module does not apply the plugin: https://github.com/mikepenz/AboutLibraries/blob/develop/app/build.gradle#L5 ?
The plugin needs to be applied so it can hook up with the android build steps.
If you would prefer it not running automatically you can run it manually via cli
and add the output to your SCM. (Make sure to pass the file to the LibraryContainer
in that case.
That's for example done in the desktop app sample: https://github.com/mikepenz/AboutLibraries/blob/develop/app-desktop/README.md
Thank You.
It works with this change.