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

cannot access SupportSQLiteDatabase #475

Closed
hirani89 opened this issue Sep 9, 2019 · 2 comments
Closed

cannot access SupportSQLiteDatabase #475

hirani89 opened this issue Sep 9, 2019 · 2 comments

Comments

@hirani89
Copy link

hirani89 commented Sep 9, 2019

I get the error below when trying to compile my app.

error: cannot access SupportSQLiteDatabase
class file for androidx.sqlite.db.SupportSQLiteDatabase not found

When I use the gradle method, everything works like a charm. But after building the project myself and and implementing the generated .aar file in my project, it does not seem to work.

The are no instructions on what to do after building the project yourself. How do I use the generated .aar file in my project successfully?

Regards,

@commonsguy
Copy link
Collaborator

commonsguy commented Sep 9, 2019

But after... implementing the generated .aar file in my project

How exactly are you doing this?

From your symptoms, my guess is that you copied the AAR into some directory (e.g., libs/) and are adding it to the project Gradle file via a statement like implementation fileTree(dir: 'libs', include: ['*.aar']). If so, that will not work for most AAR files. That approach only adds the AAR itself, not any transitive dependencies. The pre-built AAR is distributed via a Maven repository, with a POM file that contains a list of the transitive dependencies, so Gradle knows to download them. You would need to decide how to include those transitive dependencies in your project. One simple but crude approach is to copy the relevant lines from the library's build.gradle file into your own (in this case, implementation "androidx.sqlite:sqlite:2.0.1").

@hirani89
Copy link
Author

Thanks. All now working.

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

No branches or pull requests

2 participants