google-developer-training / android-basics-kotlin-lemonade-app Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
the app doesn't work on Android studio version:
popping out error:
Starting Gradle Daemon...
Gradle Daemon started in 1 s 560 ms
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 8s
and can't be run
Download code button doesn't seem to exist
Make sure when loading to Android Studio that the file is loaded from within this level of the file path, otherwise it will not load properly.
Loads correctly:
C:\Users'username'\AndroidStudioProjects\android-basics-kotlin-lemonade-app-main\android-basics-kotlin-lemonade-app-main\
Does not load correctly:
C:\Users'username'\AndroidStudioProjects\android-basics-kotlin-lemonade-app-main\
I wouldn't call it a mistake but while testing the lemonade app, the screenshot on the code lab presents only 1 failures while I got 5 errors while trying to to test the app! While going through the tests I was only able to get success on "test_squeeze_count_snackbar_display". I'll attach my code in case there is anything wrong I have coded that is causing test failures!
New Text Document (2).txt
I don't know if you can consider this as an issue. In the lemonade app, I downloaded the zip file. Then, I opened it in the android studio. I browse it to where the folder is, I clicked the folder. And click the button to open it. And it opens. You can see everything, what is in the folder. It was set up in the project category but not in the android. When I run, there was a problem. I need to set up a configuration like the module, the default settings. I was about to give up just like the last time but then, I tried to open it again but this time, I clicked not just in the folder but directly to the main. And it set up in the android. And I can run the program right away.
So, the issue was, you have to locate the main inside the folder if you use the open button of the android studio. Clicking just the folder will open it but you cannot run it.
Hello,
When I try to run the tests no matter which test I run I get this error:
11-18 17:37:17.552 8725 8746 E TestRunner: ----- begin exception -----
11-18 17:37:17.553 8725 8746 E TestRunner: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared <intent-filter>?
11-18 17:37:17.553 8725 8746 E TestRunner: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2158)
11-18 17:37:17.553 8725 8746 E TestRunner: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1805)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.runner.MonitoringInstrumentation.execStartActivity(MonitoringInstrumentation.java:564)
11-18 17:37:17.553 8725 8746 E TestRunner: at android.app.ContextImpl.startActivity(ContextImpl.java:1101)
11-18 17:37:17.553 8725 8746 E TestRunner: at android.content.ContextWrapper.startActivity(ContextWrapper.java:454)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:431)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:437)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:265)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:207)
11-18 17:37:17.553 8725 8746 E TestRunner: at com.example.lemonade.LemonadeTests.setup(LemonadeTests.kt:120)
11-18 17:37:17.553 8725 8746 E TestRunner: at java.lang.reflect.Method.invoke(Native Method)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:76)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:128)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:27)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
11-18 17:37:17.553 8725 8746 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
11-18 17:37:17.553 8725 8746 E TestRunner: at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:444)
11-18 17:37:17.553 8725 8746 E TestRunner: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2322)
11-18 17:37:17.553 8725 8746 E TestRunner: ----- end exception -----
I have tried to search on google but I have not been able to find and answer as to what is causing this. Can someone help me figure this out?
When I run the app itself everything seems to work as it should it is just the tests that do not work.
Hello,
I noticed a slight discrepancy between the TODO instructions, and the resource names:
The starter code for this project has several commented TODO sections. The TODOs that correspond to task 5 say
"
// TODO: for each state, the textAction TextView should be set to the corresponding string from
// the string resources file. The strings are named to match the state
// TODO: Additionally, for each state, the lemonImage should be set to the corresponding
// drawable from the drawable resources. The drawables have the same names as the strings
// but remember that they are drawables, not strings.
"
This is not quite accurate: lemon_empty_glass is the name of the text resource corresponding to to the RESET state. To match the state, as claimed by the TODO comments, and keep the same naming convention as the rest of the string resources, this one should be name lemon_restart.
Similarly, the starting state is SELECT, but the name of the drawable resource for this state is not the same as name of the text resource for this state, as claimed by the TODOS: the text resource is named lemon_select, while the drawable resource is named lemon_tree.
Thank you for your time,
Alan
In the build.gradle
dependencies {
//...
androidTestImplementation "androidx.test:core-ktx:1.4.0"
//...
}
has to be upgraded to
dependencies {
...
androidTestImplementation "androidx.test:core-ktx:1.5.0"
...
}
Otherwise Tests fail with exception: android.content.ActivityNotFoundException
(got hint from android/android-test#1412 )
While doing Lemonade app, I encountered an error while using lemonImage
variable to setImageResource
images. But there is an error on dot operator
. It says Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ImageView?
. Although, is was fixed by the suggestion given by the Android studio, but I feel since the course has not yet explained the use of ?
, it can be problematic for some people.
In which task and step of the codelab can this issue be found?
I cant run the app
Describe the problem
i tried re installing android studio and also another time configuring sdk .but it keep showing error "Unable to determine application id: com.android.tools.idea.run.ApkProvisionException: ERROR: APK path is not specified for module "main"".
.help me i tried every thing
Steps to reproduce?
Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.
Project: Lemonade app, task 7: Testing instructions
All tests in the LemonadeTests test case fail with the exception
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
Versions
Android Studio version: Android Studio Dolphin | 2021.3.1 Patch 1
API version of the emulator: Pixel 4a running Android Tiramisu, API level 33
A mismatch between instructions in the web app and in the code comments.
Web app:
Step 2: Implement clickLemonImage()
- DRINK: Transition to the RESTART state and set the lemonSize to -1.
Comment in the source code:
private fun clickLemonImage()
// TODO: When the image is clicked in the SQUEEZE state the squeezeCount needs to be // INCREASED by 1 and lemonSize needs to be DECREASED by 1. // - If the lemonSize has reached 0, it has been juiced and the state should become DRINK // - Additionally, lemonSize is no longer relevant and should be set to -1 // TODO: When the image is clicked in the DRINK state the state should become RESTART
On Page 5 Step 2: Implement clickLemonImage(), the instructions for sub-step 2 are ambiguous:
SQUEEZE: Increment the squeezeCount by 1 and decrement the lemonSize by 1. Remember that a lemon will require a variable number of squeezes before the squeezeCount. Transition to the DRINK state only if the new lemonSize is equal to 0. Otherwise, the app should remain in the SQUEEZE state.
Should this read "Remember that a lemon will require a variable number of squeezes before changing to a "drink" state?
My apologies if this is the wrong way to request help
please can someone help with how to fix a null pointer exception on this project i have tried several stuffs it is not working
The resources required for this activity is nowhere to be found.
tl;dr: this only happens on APIs 22, 23; not on 24,26,29 where all tests pass.
In which task and step of the codelab can this issue be found?
7. Testing instructions
Describe the problem
5 of 6 tests are failing and either I don't understand why&how(most likely), or the tests are bugged(unlikely, but I'm under this impression currently)
The app itself seems to be working as expected though. Unless I'm missing something that is currently eluding me. Help?
Steps to reproduce?
Versions
Android Studio version:
Android Studio Arctic Fox | 2020.3.1 Patch 1
Build #AI-203.7717.56.2031.7621141, built on August 7, 2021
Runtime version: 11.0.10+0-b96-7249189 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 7 6.1
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
API version of the emulator: api 23
Additional information
Include screenshots if they would be useful in clarifying the problem.
This is the output for only the test_initial_state
test:
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has drawable resource 2131165303' doesn't match the selected view.
Expected: has drawable resource 2131165303
Got: "AppCompatImageView{id=2131230909, res-name=image_lemon_state, visibility=VISIBLE, width=320, height=400, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@75e36fb, tag=null, root-is-layout-requested=false, has-input-connection=false, x=200.0, y=312.0}"
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:16)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:36)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:103)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:31)
at com.example.lemonade.BaseTest.testState(BaseTest.kt:56)
at com.example.lemonade.LemonadeTests.test_initial_state(LemonadeTests.kt:48)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:154)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: junit.framework.AssertionFailedError: 'has drawable resource 2131165303' doesn't match the selected view.
Expected: has drawable resource 2131165303
Got: "AppCompatImageView{id=2131230909, res-name=image_lemon_state, visibility=VISIBLE, width=320, height=400, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@75e36fb, tag=null, root-is-layout-requested=false, has-input-connection=false, x=200.0, y=312.0}"
at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:17)
at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:15)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:10)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:11)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Output for the other failing tests:
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with string from resource id: <2131623979>' doesn't match the selected view.
Expected: with string from resource id: <2131623979>[lemon_drink] value: Click to drink your lemonade!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@69bd4c7, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:16)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:36)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:103)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:31)
at com.example.lemonade.BaseTest.testState(BaseTest.kt:55)
at com.example.lemonade.LemonadeTests.test_squeezing_lemon_proceeds_to_drink_state(LemonadeTests.kt:69)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:154)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: junit.framework.AssertionFailedError: 'with string from resource id: <2131623979>' doesn't match the selected view.
Expected: with string from resource id: <2131623979>[lemon_drink] value: Click to drink your lemonade!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@69bd4c7, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:17)
at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:15)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:10)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:11)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'has drawable resource 2131165302' doesn't match the selected view.
Expected: has drawable resource 2131165302
Got: "AppCompatImageView{id=2131230909, res-name=image_lemon_state, visibility=VISIBLE, width=320, height=400, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@ea9a236, tag=null, root-is-layout-requested=false, has-input-connection=false, x=200.0, y=312.0}"
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:16)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:36)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:103)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:31)
at com.example.lemonade.BaseTest.testState(BaseTest.kt:56)
at com.example.lemonade.LemonadeTests.test_picking_lemon_proceeds_to_squeeze_state(LemonadeTests.kt:58)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:154)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: junit.framework.AssertionFailedError: 'has drawable resource 2131165302' doesn't match the selected view.
Expected: has drawable resource 2131165302
Got: "AppCompatImageView{id=2131230909, res-name=image_lemon_state, visibility=VISIBLE, width=320, height=400, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=true, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@ea9a236, tag=null, root-is-layout-requested=false, has-input-connection=false, x=200.0, y=312.0}"
at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:17)
at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:15)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:10)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:11)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with string from resource id: <2131623980>' doesn't match the selected view.
Expected: with string from resource id: <2131623980>[lemon_empty_glass] value: Click to start again!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@f6774f6, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:16)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:36)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:103)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:31)
at com.example.lemonade.BaseTest.testState(BaseTest.kt:55)
at com.example.lemonade.LemonadeTests.test_drinking_juice_proceeds_to_restart_state(LemonadeTests.kt:97)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:154)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: junit.framework.AssertionFailedError: 'with string from resource id: <2131623980>' doesn't match the selected view.
Expected: with string from resource id: <2131623980>[lemon_empty_glass] value: Click to start again!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@f6774f6, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:17)
at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:15)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:10)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:11)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
androidx.test.espresso.base.DefaultFailureHandler$AssertionFailedWithCauseError: 'with string from resource id: <2131623981>' doesn't match the selected view.
Expected: with string from resource id: <2131623981>[lemon_select] value: Click to select a lemon!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@43787a8, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at dalvik.system.VMStack.getThreadStackTrace(Native Method)
at java.lang.Thread.getStackTrace(Thread.java:580)
at androidx.test.espresso.base.DefaultFailureHandler.getUserFriendlyError(DefaultFailureHandler.java:16)
at androidx.test.espresso.base.DefaultFailureHandler.handle(DefaultFailureHandler.java:36)
at androidx.test.espresso.ViewInteraction.waitForAndHandleInteractionResults(ViewInteraction.java:103)
at androidx.test.espresso.ViewInteraction.check(ViewInteraction.java:31)
at com.example.lemonade.BaseTest.testState(BaseTest.kt:55)
at com.example.lemonade.LemonadeTests.test_restarting_proceeds_to_pick_lemon_state(LemonadeTests.kt:112)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:80)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:154)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:395)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
Caused by: junit.framework.AssertionFailedError: 'with string from resource id: <2131623981>' doesn't match the selected view.
Expected: with string from resource id: <2131623981>[lemon_select] value: Click to select a lemon!
Got: "MaterialTextView{id=2131231095, res-name=text_action, visibility=VISIBLE, width=384, height=49, has-focus=false, has-focusable=false, has-window-focus=true, is-clickable=false, is-enabled=true, is-focused=false, is-focusable=false, is-layout-requested=false, is-selected=false, layout-params=androidx.constraintlayout.widget.ConstraintLayout$LayoutParams@43787a8, tag=null, root-is-layout-requested=false, has-input-connection=false, x=168.0, y=263.0, text=Click to juice the lemon!, input-type=0, ime-target=false, has-links=false}"
at androidx.test.espresso.matcher.ViewMatchers.assertThat(ViewMatchers.java:17)
at androidx.test.espresso.assertion.ViewAssertions$MatchesViewAssertion.check(ViewAssertions.java:15)
at androidx.test.espresso.ViewInteraction$SingleExecutionViewAssertion.check(ViewInteraction.java:10)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:11)
at androidx.test.espresso.ViewInteraction$2.call(ViewInteraction.java:2)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Maybe not a mistake cause i could just be stupid tbh but heres an error i got when trying to open the project. :)
The project is using an incompatible version (AGP 7.3.1) of the Android Gradle plugin. Latest supported version is AGP 7.2.0
The logic of the app could be improved:
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-project-lemonade
In which task and step of the codelab can this issue be found?
the template app is not loading
Describe the problem
I am getting the follow error when I load the app
Task 'wrapper' not found in project ':app'.
Steps to reproduce?
Versions
Android Studio 4.2.2
Build #AI-202.7660.26.42.7486908, built on June 24, 2021
Runtime version: 11.0.8+10-b944.6842174 amd64
VM: OpenJDK 64-Bit Server VM by N/A
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 4
Registry: external.system.auto.import.disabled=true
Additional information
Include screenshots if they would be useful in clarifying the problem.
run one of the tasks for more details and got this output
Task 'wrapper' not found in project ':app'.
Try:
Run gradle tasks to get a list of available tasks. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Exception is:
org.gradle.execution.TaskSelectionException: Task 'wrapper' not found in project ':app'.
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:117)
at org.gradle.execution.TaskSelector.getSelection(TaskSelector.java:82)
at org.gradle.execution.commandline.CommandLineTaskParser.parseTasks(CommandLineTaskParser.java:42)
at org.gradle.execution.TaskNameResolvingBuildConfigurationAction.configure(TaskNameResolvingBuildConfigurationAction.java:46)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:58)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter$2.proceed(DefaultBuildConfigurationActionExecuter.java:66)
at org.gradle.execution.DefaultTasksBuildExecutionAction.configure(DefaultTasksBuildExecutionAction.java:45)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:58)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter$2.proceed(DefaultBuildConfigurationActionExecuter.java:66)
at org.gradle.execution.ExcludedTaskFilteringBuildConfigurationAction.configure(ExcludedTaskFilteringBuildConfigurationAction.java:48)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.configure(DefaultBuildConfigurationActionExecuter.java:58)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.access$200(DefaultBuildConfigurationActionExecuter.java:26)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter$1.run(DefaultBuildConfigurationActionExecuter.java:44)
at org.gradle.internal.Factories$1.create(Factories.java:26)
at org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:134)
at org.gradle.api.internal.project.DefaultProjectStateRegistry.withLenientState(DefaultProjectStateRegistry.java:126)
at org.gradle.execution.DefaultBuildConfigurationActionExecuter.select(DefaultBuildConfigurationActionExecuter.java:40)
at org.gradle.initialization.DefaultTaskExecutionPreparer.prepareForTaskExecution(DefaultTaskExecutionPreparer.java:38)
at org.gradle.initialization.BuildOperatingFiringTaskExecutionPreparer$CalculateTaskGraph.populateTaskGraph(BuildOperatingFiringTaskExecutionPreparer.java:117)
at org.gradle.initialization.BuildOperatingFiringTaskExecutionPreparer$CalculateTaskGraph.run(BuildOperatingFiringTaskExecutionPreparer.java:68)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:395)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:387)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:84)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.run(DelegatingBuildOperationExecutor.java:31)
at org.gradle.initialization.BuildOperatingFiringTaskExecutionPreparer.prepareForTaskExecution(BuildOperatingFiringTaskExecutionPreparer.java:56)
at org.gradle.initialization.DefaultGradleLauncher.prepareTaskExecution(DefaultGradleLauncher.java:227)
at org.gradle.initialization.DefaultGradleLauncher.doClassicBuildStages(DefaultGradleLauncher.java:159)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:140)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:120)
at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:74)
at org.gradle.internal.invocation.GradleBuildController$1.create(GradleBuildController.java:67)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:180)
at org.gradle.internal.work.StopShieldingWorkerLeaseService.withLocks(StopShieldingWorkerLeaseService.java:40)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:67)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:56)
at org.gradle.tooling.internal.provider.runner.BuildModelActionRunner.run(BuildModelActionRunner.java:54)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.BuildOutcomeReportingBuildActionRunner.run(BuildOutcomeReportingBuildActionRunner.java:63)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.BuildCompletionNotifyingBuildActionRunner.run(BuildCompletionNotifyingBuildActionRunner.java:39)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:51)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$3.call(RunAsBuildOperationBuildActionRunner.java:45)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:409)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:399)
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:157)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:242)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:150)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:94)
at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:45)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:50)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$1.transform(InProcessBuildActionExecuter.java:47)
at org.gradle.composite.internal.DefaultRootBuildState.run(DefaultRootBuildState.java:80)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:31)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:42)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:28)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:87)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:55)
at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:60)
at org.gradle.tooling.internal.provider.SubscribableBuildActionExecuter.execute(SubscribableBuildActionExecuter.java:38)
at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:68)
at org.gradle.tooling.internal.provider.SessionScopeBuildActionExecuter.execute(SessionScopeBuildActionExecuter.java:38)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:37)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:60)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:32)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:56)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:42)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:48)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:32)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:68)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:39)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:29)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:35)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:78)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.create(ForwardClientInput.java:75)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:75)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:63)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:104)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:52)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Hello, after downloading and unzipping the file, I cannot even start doing the project because the gradle: build or similar is hogging tons of RAM. Each time I retry and open task manager, there are almost one hundred OpenJDK Platform Binary tasks are running and take up to 95% RAM. Due to this, I keep getting the error like below:
Check the JVM arguments defined for the gradle process in:
My laptop has 8GB RAM and still runs out of RAM in no time, how strong is my device supposed to be to run this project????
I've done this on three new computers and each time I need to install Android SDK Build-Tools 30.0.3 (build-tools;30.0.3) and
Android SDK Platform 30 (platforms;android-30). Maybe others are having issues because I couldn't work on the project until I found this
URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem
from Step 2: I dont understand how to change state or anything.
Steps to reproduce?
Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.
The images required for the Lemonade app is missing. A link could have been provided to download them or else the images should have been already in the project.
URL of codelab
In which task and step of the codelab can this issue be found?
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraint_Layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<TextView
android:id="@+id/text_action"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/lemon_select"
android:textSize="18sp"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toTopOf="@id/image_lemon_state"/>
<ImageView
android:id="@+id/image_lemon_state"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
</androidx.constraintlayout.widget.ConstraintLayout>
Describe the problem
My xml file is not opening in design, only showing loading even after waiting for apt amount of time.
Steps to reproduce?
Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.
So I've tried for a few hours now with different configs and I've yet to be able to actually run the app successfully. I'll show my steps in order.
As marked in the top, you can see the app SDK has an X on it and when I try to run it I get the following...
I noticed my previous codelab settings have different launch options, so I attempted to mimic and apply. This is the result...
And if I continue...
What can I do to get this running?
I've encountered errors when testing my lemonade app.
I followed tutorials rigorously!
Below is the error log, I've tried many things, but still not fixed.
02-14 07:27:36.852 32018 32038 I TestRunner: started: test_squeezing_lemon_proceeds_to_drink_state(com.example.lemonade.LemonadeTests)
02-14 07:27:36.859 32018 32038 W Settings: Setting always_finish_activities has moved from android.provider.Settings.System to android.provider.Settings.Global, returning read-only value.
02-14 07:27:36.866 32018 32038 D CompatibilityChangeReporter: Compat change id reported: 160794467; UID 10162; state: ENABLED
02-14 07:27:36.871 32018 32038 E TestRunner: failed: test_squeezing_lemon_proceeds_to_drink_state(com.example.lemonade.LemonadeTests)
02-14 07:27:36.871 32018 32038 E TestRunner: ----- begin exception -----
02-14 07:27:36.872 32018 32038 E TestRunner: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
02-14 07:27:36.872 32018 32038 E TestRunner: at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)
02-14 07:27:36.872 32018 32038 E TestRunner: at android.app.Instrumentation.execStartActivity(Instrumentation.java:1839)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.runner.MonitoringInstrumentation.execStartActivity(MonitoringInstrumentation.java:564)
02-14 07:27:36.872 32018 32038 E TestRunner: at android.app.ContextImpl.startActivity(ContextImpl.java:1101)
02-14 07:27:36.872 32018 32038 E TestRunner: at android.content.ContextWrapper.startActivity(ContextWrapper.java:454)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:431)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:437)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:265)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:207)
02-14 07:27:36.872 32018 32038 E TestRunner: at com.example.lemonade.LemonadeTests.setup(LemonadeTests.kt:120)
02-14 07:27:36.872 32018 32038 E TestRunner: at java.lang.reflect.Method.invoke(Native Method)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.internal.runner.junit4.statement.RunBefores.evaluate(RunBefores.java:76)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:162)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:128)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.Suite.runChild(Suite.java:27)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
02-14 07:27:36.872 32018 32038 E TestRunner: at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
02-14 07:27:36.872 32018 32038 E TestRunner: at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:444)
02-14 07:27:36.872 32018 32038 E TestRunner: at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2361)
02-14 07:27:36.872 32018 32038 E TestRunner: ----- end exception -----
02-14 07:27:36.876 32018 32038 I TestRunner: finished: test_squeezing_lemon_proceeds_to_drink_state(com.example.lemonade.LemonadeTests)
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2197)
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1839)
at androidx.test.runner.MonitoringInstrumentation.execStartActivity(MonitoringInstrumentation.java:564)
at android.app.ContextImpl.startActivity(ContextImpl.java:1101)
at android.content.ContextWrapper.startActivity(ContextWrapper.java:454)
at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:431)
at androidx.test.core.app.InstrumentationActivityInvoker.startActivity(InstrumentationActivityInvoker.java:437)
at androidx.test.core.app.ActivityScenario.launchInternal(ActivityScenario.java:265)
at androidx.test.core.app.ActivityScenario.launch(ActivityScenario.java:207)
at com.example.lemonade.LemonadeTests.setup(LemonadeTests.kt:120)
When I want to run the app in emulator after I downloaded the code, I get this error message:
"Error while waiting for device: Illegal char <*> at index 0: *.lock"
I haven't changed anything in the code yet.
What can I do to run the app and continue learning?
Theres a bug the in source code you provide for the Lemonade App. The bug is in onCreate() when you set lemonImage. The problem is that it's supposed to say R.id.ImageView but it says lemonade_image_something instead, which is in red. This bug is also presented in the tests.
I'm trying to do the lemonade codelabe, after I load the file in android studio. and try to use activity_main.xml nothing happens it just loads. I also get the error that the version of gradle isn't up to date and also it doesn't recognize gradle at times as well, I'm not sure how to proceed please help
All the tests initially failed with this message:
Don't keep activities" developer options must be disabled for ActivityScenario
It took a little time Googling to figure out how to fix this.
Perhaps this should be mentioned?
So I'm running the latest version of Android Studios and after downloading this source code and opening it as a new project, I can't even begin to start working on it because it has 148 errors. Is this intentional? Am I supposed to figure out how to resolve all 148 errors before I even begin the project? I'm having some real difficulties with this one, but maybe I did something fundamentally wrong that screwed it up from the beginning. If anyone could help, that would be awesome.
I've downloaded the Lemonade sample app for https://developer.android.com/codelabs/basic-android-kotlin-training-project-lemonade and am checking the codelabs in that module. The final section, "Testing instructions," is comprehensively failing in an unexpected way:
android.content.ActivityNotFoundException
: Unable to find explicit activity class{com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}
; have you declared this activity in yourAndroidManifest.xml
, or does your intent not match its declared<intent-filter>
?
I'm guessing this is a project configuration error, missing AndroidX libraries or something similar? The whole project is presented as download-then-import, so perhaps the downloadable project is out of date now with respect to the current release version of Android Studio?
URL of codelab
In which task and step of the codelab can this issue be found?
Step 7: Testing Instructions
Describe the problem
The test: test_picking_lemon_proceeds_to_squeeze_state
provided in the project for the lemonade project will fail if the student correctly implements the setViewElements()
method using string resource: lemon_squeeze
along with the squeezeCount
variable to update the string resource with the number of squeezes so far:
textAction.text = resources.getString(R.string.lemon_squeeze, squeezeCount)
However, the test will pass with the code textAction.setText(R.string.lemon_squeeze)
which will not correctly display the updated squeeze count in the text view.
Steps to reproduce?
Versions
Android Studio version: 2021.2.1 | Chipmunk
API version of the emulator: 31
Additional information
Include screenshots if they would be useful in clarifying the problem.
Project: Lemonade App, Task 7: Testing instructions
All tests in the LemonadeTests test case fail with the exception
android.content.ActivityNotFoundException: Unable to find explicit activity class {com.example.lemonade.test/androidx.test.core.app.InstrumentationActivityInvoker$BootstrapActivity}; have you declared this activity in your AndroidManifest.xml, or does your intent not match its declared ?
Steps to reproduce?
Versions
Android Studio version: Android Studio Electric Eel | 2022.1.1 Patch 1
API version of the emulator: 33
The instructions for implementing the clickLemonImage
function do not match the comments in the project repository.
The comments in the project state:
// TODO: When the image is clicked in the SQUEEZE state the squeezeCount needs to be
// INCREASED by 1 and lemonSize needs to be DECREASED by 1.
// - If the lemonSize has reached 0, it has been juiced and the state should become DRINK
// - Additionally, lemonSize is no longer relevant and should be set to -1
// TODO: When the image is clicked in the DRINK state the state should become RESTART
whereas the codelab exercise states:
SQUEEZE
: Increment the squeezeCount
by 1 and decrement the lemonSize
by 1. Remember that a lemon willsqueezeCount
Transition to the DRINK
state only if the newlemonSize
is equal to 0. Otherwise, the app should remain in the SQUEEZE
state.DRINK
: Transition to the RESTART
state and set the lemonSize
to -1.As you can see, the comments say to set lemonSize
to -1
when the image is clicked in the SQUEEZE
state, whereas the codelab says to set it to -1
when the image is clicked in the DRINK
state. It's also unclear if the comments mean to say that the lemonSize
should be set to -1
iff the lemonSize
has reached 0.
In attempting to build the unzipped project i get an error message suggesting this was built on an older software and that i need to migrate it in order to access although im not able to migrate and anytime i get any further im not able to load the resources for the lemons or buttons
I believe "Googling" as a verb, is against Google styleguide for trademark reason, so I'd suggest correcting it to "searching online" or some other appropriate forms
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.