android / android/codelab-android-dynamic-features

getString won't resolve for me

Open
#36 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Kotlin
Stars
129
Forks
51
PR merge metrics
No merged PRs in 30d

Description

On the step [8. SplitInstallManager listener](https://developer.android.com/codelabs/on-demand-dynamic-delivery#7) the following code is added:
`private val moduleKotlin by lazy { getString(R.string.module_feature_kotlin) }`
`private val moduleJava by lazy { getString(R.string.module_feature_java) }`
`private val moduleNative by lazy { getString(R.string.module_native) }`
`private val moduleAssets by lazy { getString(R.string.module_assets) }`

However, getString is not happy for me. I tried a few different automatic fixes via option+enter, but none worked. I ended up just replacing this code with strings:
`private val moduleKotlin = "module_feature_kotlin"`
`private val moduleJava = "module_feature_java"`
`private val moduleNative = "module_native"`
`private val moduleAssets = "module_assets"`

I looked at the imports in the solution and don't see what I'm missing.

Contributor guide

Open the contributing guide

Research direction

Review step 8 of the linked dynamic-delivery codelab and compare the reported listener code with the solution, including its surrounding context and imports. The issue is done when the four getString references resolve in the project without replacing them with literal strings.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.