-
Notifications
You must be signed in to change notification settings - Fork 105
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
Proto DataStore: Unresolved reference dataStore #27
Comments
Check your dependencies, I was using (note -core at the end), as documentation says.
Using this dependency instead fixed my problem.
https://developer.android.com/jetpack/androidx/releases/datastore#declaring_dependencies |
@gerardoepitacio Thanks for you answer :) In the meanwhile I have found my own "workaround" by lowering the gradle version from gradle:7.0.0-alpha09 to gradle:4.1.3, but I honestly don't know why datastore doesn't work with the newest gradle version. Anyway, I will try out your solution tomorrow, and I really can't thank you enough for trying to help me and others :) 👍 |
I made it work with Android Studio Artic Fox Canary 15 and gradle pluging 7.0.0-alpha15, hope it helps someone. |
Hey I am having this issue also, even though I declare:
Whenever I look to the call to datastore the import is:
I really don't want to be downgrading the gradle build in order to get this to work. Any ideas why this is happening? - I have tried removing the core package but then Unresolved reference: DataStore |
If you changed the dependency from "-core" to the one with no "-core" make sure to sync the project, clear and rebuild. Notice that I used the Typed version, not the DataStore Preferences version. Make sure to apply the gradle plugin accordingly dependencies |
I have tried both versions of the dependency. Even invalidating the cache, and rebuilding doesn't seem to matter when I click on import the core dependency is imported. I will just use shared-prefs for now. |
I also had this problem while working on a project. I found that I was using
to:
Possibly there was a breaking change between Also posted on SO. |
Problem still persistent in February 16, 2022.
to
|
Problem:
I followed every step mentined in the Codelab tutorial https://developer.android.com/codelabs/android-proto-datastore, but Android Studio can't resolve
dataStore
(unable to importandroidx.datastore.dataStore
)How to reproduce the issue:
git clone https://github.com/googlecodelabs/android-datastore
/app/src/main/proto
user_prefs.proto
in/app/src/main/proto
according to https://developer.android.com/codelabs/android-proto-datastore#5UserPreferencesSerializer
in packagedata
and insert Code mentioned in https://developer.android.com/codelabs/android-proto-datastore#5UserPreferencesSerializer
TasksActivity
according to https://developer.android.com/codelabs/android-proto-datastore#6Now Android Studio marks
by dataStore
asUnresolved reference: dataStore
and I'm also unable to importimport androidx.datastore.dataStore
Please can someone tell me how I can resolve this issue? I followed every steps mentioned in the tutorial and compared the solution files with my local project, but it still doesn't work.
The text was updated successfully, but these errors were encountered: