Proto DataStore: Unresolved reference dataStore
@mmoczkowski 已经在做这个了。
开始于 2022年9月9日。
评估
这个 Issue 还没有评估数据。
描述
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 import androidx.datastore.dataStore)
How to reproduce the issue:
- Download the base project
git clone https://github.com/googlecodelabs/android-datastore - modify gradle file according to https://developer.android.com/codelabs/android-proto-datastore#4
- create folder
/app/src/main/proto - create file
user_prefs.protoin/app/src/main/protoaccording to https://developer.android.com/codelabs/android-proto-datastore#5 - Build -> Clean Project
- Build -> Rebuild Project (proto files get successfully generated)
- Generate
UserPreferencesSerializerin packagedataand insert Code mentioned in https://developer.android.com/codelabs/android-proto-datastore#5 - Add all missing imports in class
UserPreferencesSerializer - Modify
TasksActivityaccording to https://developer.android.com/codelabs/android-proto-datastore#6
Now Android Studio marks by dataStore as Unresolved reference: dataStore and I'm also unable to import import androidx.datastore.dataStore
private val Context.userPreferencesStore: DataStore<UserPreferences> by dataStore(
fileName = DATA_STORE_FILE_NAME,
serializer = UserPreferencesSerializer
)
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.
- 主要语言
- Kotlin
- 星标
- 240
- 派生
- 113
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
android/codelab-android-datastore 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
-
难度 4/5 3-5 天 新手友好度 25/100
android/codelab-android-datastore#83 · 1 条评论 · 2 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 45/100
-
难度 1/5 1 小时以内 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 35/100
查看 android/codelab-android-datastore 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
tauri-apps/tauri#16173 ·
维护者通常 2 天内回复
-
feature
难度 1/5 1 小时以内 新手友好度 90/100
维护者通常 1 天内回复
-
QUIC: flow-control window collapses to 32 KiB after first 10 MiB per stream (bump netty to 4.2.18)未关闭
难度 2/5 1-3 小时 新手友好度 78/100
libp2p/jvm-libp2p#532 · 1 个 reaction ·
-
maplibre-native
难度 2/5 1-3 小时 新手友好度 76/100
maplibre/maplibre-compose#1591 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复