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

dependency error #185

Open
BlackWhite7 opened this issue Nov 22, 2024 · 1 comment
Open

dependency error #185

BlackWhite7 opened this issue Nov 22, 2024 · 1 comment

Comments

@BlackWhite7
Copy link

URL of codelab:
https://developer.android.com/codelabs/basic-android-kotlin-compose-add-repository?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-compose-unit-5-pathway-2%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-compose-add-repository&_gl=1*4ahl6p*_up*MQ..*_ga*MTY4ODkyMjI1OS4xNzMyMjYwMjI4*_ga_6HH9YJMN9M*MTczMjI2MDIyOC4xLjAuMTczMjI2MDIyOC4wLjAuMjEwNzczNjUwNw..#6

Specify the language of the codelab if it is not English:

In which task and step of the codelab can this issue be found?
[7. Get setup for local tests]

Describe the problem
When you add the local test dependencies, the document suggests like this.
testImplementation("junit:junit:4.13.2")
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1")

But, in the code, when you use runTest() lambda function,
JavaStudio can not import kotlinx.coroutines.test package for runTest.

To get around this problem, I have to change the second dependency to real 'implementaion' like this.
testImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1")
---> implementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.1")

Steps to reproduce?

  1. Go to...
  2. Click on...
  3. See error...

Versions
Android Studio version:
API version of the emulator:

Additional information
Include screenshots if they would be useful in clarifying the problem.

@BlackWhite7
Copy link
Author

I have checked my test file location. It is in the src/androidTest/java/ < my_ package> . I have changed the location to src/test/java/<my_package> .   My test is for unit tests not for instrumented tests.  There is no more problem.I have checked my test file location. It is in the src/androidTest/java/ < my_ package> . I have changed the location to src/test/java/<my_package> .   My test is for unit tests not for instrumented tests.  There is no more problem.

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

1 participant