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

How to keep class with ViewDataBinding - Error class: unknown class and show subModule #235

Open
longquangpham90 opened this issue May 8, 2024 · 5 comments
Labels
affects:android bug Something isn't working 🌱 contributions welcome Good for newcomers, pull requests welcome help wanted Extra attention is needed

Comments

@longquangpham90
Copy link

I have class with ViewDataBinding
Screenshot 2024-05-08 at 11 19 23

Screenshot 2024-05-08 at 11 20 53 How to keep it when export documents Screenshot 2024-05-08 at 11 21 35

And I want to show sub-module features(splash, intro, search-bill). Currently we can not show its

Screenshot 2024-05-08 at 11 23 32
@aSemy
Copy link
Contributor

aSemy commented May 8, 2024

Hi @longquangpham90, thanks for the report!

I can see see that you're encountering an "Error class: unknown class" error in the rendered HTML. However, I can't see see any obvious problem. I'd like to help, but I'd need more info. I'm not familiar with Android development. Can you share the project, or an example? How can I reproduce it? What versions of Gradle/Kotlin/Android/Dokkatoo are you using? What's the project structure? How many subprojects have you got? What configuration have you used?

@aSemy aSemy added bug Something isn't working question Further information is requested labels May 8, 2024
@longquangpham90
Copy link
Author

Hi @aSemy
I have invite project example
Could you help me check project it
My project setup with multi module, we want to have document the same folder module project and by pass issue Error class: unknown class
Many thanks!

@aSemy
Copy link
Contributor

aSemy commented May 9, 2024

Thanks! I can't see anything wrong.

I can see that it's quite a large project, and I don't have time to investigate something of this size really. Also, because the project is quite big I can't download it, for security reasons.

I did have a look through though, and I have some notes:

  • I couldn't find the source code for the FragmentSplashBinding class (GitHub doesn't let you search for code in branches, so maybe I missed it). Are you sure such a class exists?
  • I can see that the project uses script plugins. That might interfere with Dokka discovering information from AGP. I recommend using convention plugins instead.

@aSemy aSemy removed the bug Something isn't working label May 9, 2024
@longquangpham90
Copy link
Author

Thanks @aSemy
"FragmentSplashBinding" is a class generated by the Android Data Binding Library when you use Data Binding in your Android app. It is generated from a layout XML file named "fragment_splash.xml" in this case. This class contains references to UI components in the layout XML

@aSemy
Copy link
Contributor

aSemy commented May 10, 2024

Ahh okay. So if it's generated, you might need to tell Dokkatoo to use the generated sources. Those generated files are used during compilation, so Dokkatoo should detected them automatically, but I guess that's not the case...

I'd really like to fix it, but I'm really not an Android dev. Could you help me out and create a smaller reproducer? Does it need to be a multi-module project, or does it also happen in a single module project?

To fix it in the meantime, you could try telling Dokkatoo about the source directory. Something like this:

// build.gradle.kts

// ...

dokkatoo {
    dokkatooSourceSets.named("main") {
        sourceRoots.from( /* TODO tasks.named("nameOfTaskThatGeneratesSources") */ )
    }
}

@aSemy aSemy added bug Something isn't working 🌱 contributions welcome Good for newcomers, pull requests welcome help wanted Extra attention is needed affects:android and removed question Further information is requested labels May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:android bug Something isn't working 🌱 contributions welcome Good for newcomers, pull requests welcome help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants