google-developer-training / android-basics-kotlin-cupcake-app Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel
In which task and step of the codelab can this issue be found?
Step 2: Starter code walkthrough
Describe the problem
In the section describing the AppCompatActivity, the definitions change from
-AppCompatActivity(R.layout.activity_main) to
-setContentView(R.layout.main_activity)
The resource id name changes and might confuse new users
Steps to reproduce?
override fun onSupportNavigateUp(): Boolean { return navController.navigateUp() || super.onSupportNavigateUp() }
app crashes when this line is added and the up button is hit
Versions
Android Studio version: Artic Fox 2020.3.1
Pixel 4 XL API 30
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Task: 7
Step: "Update the layout to display pickup options"
Describe the problem
The text "...view model, update the PickupFragment to display..." should read "...view model, update the fragment_pickup.xml to display..."
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack
In which task and step of the codelab can this issue be found?
5. Send the order
Describe the problem
In the code for the full sendOrder() method, the last argument for getString() that will be placed in the orderSummary variable is sharedViewModel.priceString.value.toString(), however this should be sharedViewModel.price.value.toString().
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.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack#4
In which task and step of the codelab can this issue be found?
5. Send the order > 9. Then format the order_details...
Describe the problem
It is written sharedViewModel.priceString.value.toString()
instead of sharedViewModel.price.value.toString()
Shared ViewModels Across Fragments: Step 7
Describe the problem
The text on the PickupFragment radio buttons are blank and won't fill in despite using the databinding commands in XML (I copy pasted from the codelab). The FlavorFragment XML databinding (basically doing the exact same thing) works fine so I'm not sure what's going on.
I made sure the text wasn't white (hah) and I can set the android:text attribute with a hardcoded String and it shows up fine.
I also checked my current code against the solution code and everything seems fine, nothing out of place. Any ideas?
In which task and step of the codelab can this issue be found?
3. Implement Up button behavior
Describe the problem
after I added the following code in the MainActivity class:
41 override fun onSupportNavigateUp(): Boolean {
42 return navController.navigateUp() || super.onSupportNavigateUp()
43 }
When I click the back arrow on the actionbar on top of the app, the app crashes.
Logcat window:
2021-04-13 13:39:14.168 12770-12770/com.example.cupcake E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.cupcake, PID: 12770
kotlin.UninitializedPropertyAccessException: lateinit property navController has not been initialized
at com.example.cupcake.MainActivity.onSupportNavigateUp(MainActivity.kt:42)
at androidx.appcompat.app.AppCompatActivity.onMenuItemSelected(AppCompatActivity.java:235)
at androidx.appcompat.view.WindowCallbackWrapper.onMenuItemSelected(WindowCallbackWrapper.java:109)
at androidx.appcompat.widget.ToolbarWidgetWrapper$1.onClick(ToolbarWidgetWrapper.java:188)
at android.view.View.performClick(View.java:7448)
at android.view.View.performClickInternal(View.java:7425)
at android.view.View.access$3600(View.java:810)
at android.view.View$PerformClick.run(View.java:28305)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7656)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
2021-04-13 13:39:14.269 12770-12770/com.example.cupcake I/Process: Sending signal. PID: 12770 SIG: 9
Versions
Android Studio version: 4.1.3
API version of the emulator: Pixel4 API 30
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel
In which task and step of the codelab can this issue be found?
Starter app overview, step 2 - Get the code
Describe the problem
When you download the code, you automatically download the main branch, which is the complete version of the app and it can't be used to learn the unit since it is already complete and has all of the missing pieces. You can set the correct branch in git but someone who's not used to using git(or doesn't know about version control) will not be able to use the code to learn by doing.
Steps to reproduce?
Versions
_Android Studio version: Not relevant
_API version of the emulator: Not relevant
Additional information
It can easily be changed by just doing a checkout to the correct branch but it might be useful to explain that on the codelab
In which task and step of the codelab can this issue be found?
5. Send the order
Describe the problem
this line of code -> sharedViewModel.priceString.value.toString()
should be -> sharedViewModel.price.value.toString()
Steps to reproduce?
Click on...
fun sendOrder() {
val numberOfCupcakes = sharedViewModel.quantity.value ?: 0
val orderSummary = getString(
R.string.order_details,
resources.getQuantityString(R.plurals.cupcakes, numberOfCupcakes, numberOfCupcakes),
sharedViewModel.flavor.value.toString(),
sharedViewModel.date.value.toString(),
sharedViewModel.priceString.value.toString()
)
val intent = Intent(Intent.ACTION_SEND)
.setType("text/plain")
.putExtra(Intent.EXTRA_SUBJECT, getString(R.string.new_cupcake_order))
.putExtra(Intent.EXTRA_TEXT, orderSummary)
if (activity?.packageManager?.resolveActivity(intent, 0) != null) {
startActivity(intent)
}
}
See error...
line -> sharedViewModel.priceString.value.toString()
Versions
Android Studio version: 4.1.2
API version of the emulator: no
Additional information my first report
Include screenshots if they would be useful in clarifying the problem.
https://gyazo.com/47ebe67bf9b7030467962c176b8c3335
In 2nd Step, sendOrder()?
sharedViewModel.price.value.toString() is always null
Steps to reproduce?
Versions
Android Studio version: Android Studio Arctic Fox | 2020.3.1 Patch 3
API version of the emulator: 30.9.5-7820599
Additional information
Transformation methods for LiveData.
These methods permit functional composition and delegation of LiveData instances. The transformations are calculated lazily, and will run only when the returned LiveData is observed. Lifecycle behavior is propagated from the input source LiveData to the returned one.
sharedViewModel.price.value.toString() is always null. Since it uses Transformation method, it needs to be observed
In which task and step of the codelab can this issue be found?
3. Implement Up button behavior
Describe the problem
After importing the source project [android-basics-kotlin-cupcake-app-viewmodel], the instructions indicate to add an override for the 'onSupportNavigateUp' function.
Upon implementing the lateinit var navController or overriding the fuction, the app crashes when using the 'back' (or up navigate button).
Steps to reproduce?
Versions
_Android Studio version:Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 10, 2021
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 8
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: org.jetbrains.kotlin
_API version of the emulator:
30
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
In which task and step of the codelab can this issue be found?
Step 3
Describe the problem
In FlavorFragment.kt, inside the goToNextScreen() method, replace the code displaying the toast to navigate to the pickup fragment. Use the action ID, R.id.action_flavorFragment_to_pickupFragmen and make sure this ID matches the action declared in your nav_graph.xml.
R.id.action_flavorFragment_to_pickupFragmen
needs a trailing 't'. Should be R.id.action_flavorFragment_to_pickupFragment
.
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.
In which task and step of the codelab can this issue be found?
3. Complete the Navigation Graph
Describe the problem
Pulling down "starter" branch for both this and the last app provides pretty much completed code. Thus the person is learning nothing about how to do things for themselves. In this specific instance, it tells you to start making the navigation graph. Well, the graph is already done for me.
Steps to reproduce?
Versions
Android Studio version: N/A
API version of the emulator: N/A
URL of codelab
https://github.com/google-developer-training/android-basics-kotlin-cupcake-app
In which task and step of the codelab can this issue be found?
#6 - Adding android:onClick="@{()...." to radio buttons on the fragment_flavor.xml layout.
Describe the problem
If you select any flavor (I selected "salted caramel", the app terminates with this exception:
java.lang.IllegalStateException: Could not find method @{() -> viewModel.setFlavor(@string/salted_caramel)(View) in a parent or ancestor Context for android:onClick attribute defined on view class com.google.android.material.radiobutton.MaterialRadioButton with id 'salted_caramel'
Steps to reproduce?
Versions
Studio Build: AI-211.7628.21.2111.8193401
Version of Gradle Plugin: 7.1.2
Version of Gradle: 7.2
Version of Java: Could not find a JAVA version anywhere, but found this: default JDK: 11.0.11
OS: Windows 10
Kotlin Plugin: JetBrains 211-1.6.10-Release-923-AS7442.40
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
[Navigation and the back stack] https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-navigation-backstack#5
In which task and step of the codelab can this issue be found?
6. Solution code
Describe the problem
Remove white-spaces surrounding the new line symbol. You get extra white-spaces at the beginning and end of lines otherwise...
Quantity: 12 cupcakes▯
▯Flavor: Vanilla▯
Pickup date: Tue Aug 24▯
▯Total: $24.00▯
▯Thank you!
Steps to reproduce?
Versions
_Android Studio version: 2021.3.1
_API version of the emulator: 30
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Step 3.2
Describe the problem
override
fun onSupportNavigateUp(): Boolean {
return navController.navigateUp() || super.onSupportNavigateUp()
}`
navController unresolved reference
Steps to reproduce?
1.Load: https://github.com/google-developer-training/android-basics-kotlin-cupcake-app/tree/viewmodel
2.Import to Android Studio
3.Write the code according to step 3.2
Versions
Android Studio version: 4.2.2
API version of the emulator: 19
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Shared ViewModel Across Fragments Task 7 step 8.
Describe the problem
The step says to:
Remove the initial values from the declaration of the properties in the class. Now you are using the init block to initialize the properties when an instance of OrderViewModel is created.
Which results in several errors: Unresolved reference, and Variable Expected
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.
In which task and step of the codelab can this issue be found?
Task 5
sharedViewModel.priceString.value.toString()
should be -> sharedViewModel.price.value.toString()
Describe the problem
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.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel#6
In which task and step of the codelab can this issue be found?
"9. Run your app again, notice today's date is selected by default."
Describe the problem
After adding the init
block and removing the initial values, it showed the NullPointerException error, as quoted below.
"7. Add an init block to the class, and call the new method resetOrder() from it."
"8. Remove the initial values from the declaration of the properties in the class. Now you are using the init block to initialize the properties when an instance of OrderViewModel is created."
"9. Run your app again, notice today's date is selected by default."
The error in Logcat:
java.lang.NullPointerException: Attempt to invoke virtual method 'void androidx.lifecycle.MutableLiveData.setValue(java.lang.Object)' on a null object reference
at com.example.cupcake.model.OrderViewModel.resetOrder(OrderViewModel.kt:56)
at com.example.cupcake.model.OrderViewModel.(OrderViewModel.kt:11)
Steps to reproduce?
As stated above.
Versions
Android Studio version: 4.2.1
API version of the emulator: 30
Additional information
Nil.
In which task and step of the codelab can this issue be found
In the MainActivity Class, after adding the following:
(i) the "private lateinit var navController: NavController"
and (ii) adding the following function:
override fun onSupportNavigateUp(): Boolean {
return navController.navigateUp() || super.onSupportNavigateUp()
}
Describe the problem
Upon running the app, when the "up" button is clicked, the "Cupcake keep stopping".
Steps to reproduce?
Versions
Android Studio version: 4.2.2
API version of the emulator: Pixel 3a AP! 28
Additional information
Include screenshots if they would be useful in clarifying the problem.
Step 3 Complete the navigation graph
Update title in app bar
Steps to reproduce?
Versions
Android Studio version: 4.2.2
API version of the emulator: 30
Additional information
Include screenshots if they would be useful in clarifying the problem. included screenshot
In which task and step of the codelab can this issue be found?
Describe the problem
I followed everything in the tutorial but when I run the app the labels for the different fragments do not change and the back arrow doesnt show, I even reinstalled android studio thinking something might be wrong with it but nothing changed and I am not sure why, so please look into it.
Steps to reproduce?
Versions
Android Studio version: bumble bee, but that happened even before I updated to bumble bee
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem. the screenshot attached is of the second fragment, with label Choose Flavor but as you can see it is still the app name Cupcake
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-navigation-backstack#2
In which task and step of the codelab can this issue be found?
3. Implement Up button behavior
Describe the problem
Click the back/up button the application quits/exits stops.
Steps to reproduce?
Additional information
Include screenshots if they would be useful in clarifying the problem.
package com.example.cupcake
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.navigation.NavController
import androidx.navigation.fragment.NavHostFragment
import androidx.navigation.ui.setupActionBarWithNavController
/**
Activity for cupcake order flow.
*/
class MainActivity : AppCompatActivity(R.layout.activity_main) {
// Make navController a class variable so you can use it in another method.
private lateinit var navController: NavController
// override the onCreate() method to set up the navigation controller. Get an instance of
// NavController from the NavHostFragment.
// Make a call to setupActionBarWithNavController(navController) passing in the instance of
// NavController. This will do the following: Show a title in the app bar based off of the
// destination's label, and display the Up button whenever you're not on a top-level
// destination.
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
val navHostFragment = supportFragmentManager
.findFragmentById(R.id.nav_host_fragment) as NavHostFragment
val navController = navHostFragment.navController
setupActionBarWithNavController(navController)
}
override fun onSupportNavigateUp(): Boolean {
return navController.navigateUp() || super.onSupportNavigateUp()
}
}
In which task and step of the codelab can this issue be found?
https://github.com/google-developer-training/android-basics-kotlin-cupcake-app/tree/viewmodel
Describe the problem
When try sync gradle, appear this warning message in Sync:
This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 2020.3.1 or newer.
Then, I tried to run "with info", appeared this in Build output:
"The specified Gradle distribution 'https://services.gradle.org/distributions/gradle-7.0.2-all.zi' does not exist."
Thanks
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.
In which task and step of the codelab can this issue be found?
5. Send the order
Describe the problem
The wrong variable name is used in the following example code in the page:
In your Kotlin code, calling:
getQuantityString(R.string.cupcakes, 1, 1) returns the string 1 cupcake
getQuantityString(R.string.cupcakes, 6, 6) returns the string 6 cupcakes
getQuantityString(R.string.cupcakes, 0, 0) returns the string 0 cupcakes
R.string.cupcakes
should actually be R.plurals.cupcakes
Steps to reproduce?
Error in Tutorial text, not in the actual code.
Versions
Not relevant.
Additional information
Not relevant.
In which task and step of the codelab can this issue be found?
in Add Navigation to the flavor and pickup fragments, 2nd point.
Describe the problem
A "t" is missing in the ID
=> R.id.action_flavorFragment_to_pickupFragmen
Versions
Android Studio version:
API version of the emulator:
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack
In which task and step of the codelab can this issue be found?
"4. Learn about tasks and back stack"
Describe the problem
There are 3 consecutive headings (I suspect the latter 2 should be list items):
Modify the back stack in the Cupcake app
Modify the FlavorFragment, PickupFragment, and SummaryFragment classes and layout files in order to offer a Cancel order button to the user.
Add navigation action
In which task and step of the codelab can this issue be found?
-Shared ViewModel Across Model
Describe the problem
I am not able to change the title of the app bar
Steps to reproduce?
Versions
Android Studio version: 4.2.1
API version of the emulator: 30_x86
Additional information
Include screenshots if they would be useful in clarifying the problem.
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack#4
In which task and step of the codelab can this issue be found?
Task: 5 Send the order
Step: 9 Modify submitOrder
Describe the problem
I think the code snippet in this step has an error: "sharedViewModel.priceString.value.toString()" in orderSummary should be sharedViewModel.price.value.toString()
In which task and step of the codelab can this issue be found?
Implement up button behavior.
Describe the problem
When including the code from the codelab and running the app crashes and closes out the app.
Steps to reproduce?
Versions
Android Studio version: 4.2.2
API version of the emulator: 29
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel#2
In which task and step of the codelab can this issue be found?
Add Navigation to the flavor and pickup fragments
Describe the problem
In the sentece, "Use the action ID, R.id.action_flavorFragment_to_pickupFragmen and make sure this ID matches the action declared in your nav_graph.xml." the id of the action is missing a 't' at the end.
It's correct in the following code block, but with a missing 't' in the description.
Steps to reproduce?
As stated above.
Versions
Not applicable.
Additional information
Nil.
In which task and step of the codelab can this issue be found?
Task 8 Step 4
Describe the problem
When testing the app, the same day pickup charge is being applied on the "Choose Flavor" screen. This is due to resetOrder() being called in the init block setting the _date value to dateOptions[0] which is always today. The code needs to either exclude _date in resetOrder() and check the first radio button automatically only when going into the "Choose Pickup Date" screen or the updatePrice() will need to be updated with a flag to differentiate whether setQuantity() or setDate() called updatePrice().
For example if setDate() calls updatePrice() and passes in a flag value of TRUE then that flag can be added to the IF condition to apply the same day pickup charge.
Steps to reproduce?
Versions
_Android Studio version: Android Studio Arctic Fox | 2020.3.1 Patch 3
_API version of the emulator: 30
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Step 7
Describe the problem
I'm new to Kotlin and has a very basic knowledge of init block. In step 7, I was instructed to add the init block in the OrderViewModel class and I did it. Suddenly my app started to crash. Then I figured it out that it does matter that where I put the init block. In the init block a method is being called which reference a property of the OrderViewModel class and i put the init block above the properties declarations so i started to get null pointer exceptions. Then I thought to put the init block below the properties declarations and it worked. The issue is You guys should have told the students to put the init block below the properties declarations.
Versions
Android Studio version: doesn't matter
API version of the emulator: doesn't matter
In which task and step of the codelab can this issue be found?
Task 2. Step 6. Update flavor with user choice
Describe the problem
The provided code for adding a new variable in fragment_flavor.xml gives errors in Android Studio:
<data>
<variable
name="viewModel"
type="com.example.cupcake.model.OrderViewModel" />
</data>
The correct code should be:
<data>
<variable
name="viewModel"
type="com.example.cupcake.OrderViewModel" />
</data>
Versions
Android Studio version: 4.2
API version of the emulator:
In which task and step of the codelab can this issue be found?
Unit 3: Pathway 4: Advanced navigation app examples
Describe the problem
In step 7 there is a link to the solution code, but the JUnit test classes are missing or the link is wrong
URL of codelab
[Navigation and the back stack] https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack?continue=https%3A%2F%2Fdeveloper.android.com%2Fcourses%2Fpathways%2Fandroid-basics-kotlin-unit-3-pathway-4%23codelab-https%3A%2F%2Fdeveloper.android.com%2Fcodelabs%2Fbasic-android-kotlin-training-navigation-backstack#4
In which task and step of the codelab can this issue be found?
5. Send the order
Describe the problem
When the order is handed over to another app via clicking the SEND button, after clicking BACK button, I navigate from that app to the Summary fragment. Would rather expect to get back to the Start fragment as the order process is completed.
Steps to reproduce?
Versions
Android Studio version: 2021.3.1
API version of the emulator: 30
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Task in Part 6 "Write ViewModels and LiveData"
Describe the problem
Test Errors, Comparison Failure, NBSP
Steps to reproduce?
expected:<[$27,00]> but was:<[27,00 Br]>
Expected :$27,00
Actual :27,00 Br
and Comparison Failure
27,00NBSPBr
Versions
Android Studio version: Bumblebee 2021.1.1 Patch 2
API version of the emulator: Test Configuration
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
Update pickup and summary fragment to use viewModel
In which task and step of the codelab can this issue be found?
In Step 6
Create function resetorder and call it in init block
_date.value = dateOptions[0] which is not available at init
Describe the problem
App stops due to unavailability of dataoptions[0] at init
URL of codelab
https://github.com/google-developer-training /
android-basics-kotlin-cupcake-app
In which task and step of the codelab can this issue be found?
9. Setup click listeners using listener binding
Describe the problem
In the layout xml files for fragment_flavor.xml and fragment_pickup.xml, the lines
android:onClick="@{() -> flavorFragment.goToNextScreen()}"
android:onClick="@{() -> pickupFragment.goToNextScreen()}"
do not compile. "goToNextScreen() results in "Cannot find identifier".
Steps to reproduce?
Versions
Android Studio version:
API version of the emulator:
Bumblebee 2021.1.1 Patch 1
Build # AI-211.7628.21.2111.8139111 on Feb 1, 2022
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
Task: 3
Step: "Update title in app bar"
Sub-step: 4
Describe the problem
The text "Open navigataion/nav_graph.xml" should read "Open navigation/nav_graph.xml"
Additional information
Include screenshots if they would be useful in clarifying the problem.
In which task and step of the codelab can this issue be found?
3
Describe the problem
The 3rd step tells to make a price check test and add this code :
Knowing that the transformation happening in OrderViewModel will format to the current locale currency info, which for me is BR info, i fixed so it would fit my nationality, then i tried :
Then i got the error on the images attached.
Steps to reproduce?
org.junit.ComparisonFailure: expected:<R$[ ]27,00> but was:<R$[ ]27,00>
Versions
Android Studio version:
Android Studio Bumblebee | 2021.1.1
Build #AI-211.7628.21.2111.8092744, built on January 19, 2022
Runtime version: 11.0.11+9-b60-7590822 amd64
VM: OpenJDK 64-Bit Server VM by Oracle Corporation
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 4096M
Cores: 4
Registry: external.system.auto.import.disabled=true, debugger.watches.in.variables=false
Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.10-release-923-AS7442.40), org.intellij.featureSuggester (211.205), org.intellij.plugins.markdown (211.7142.37)
API version of the emulator:
Android version : 11.0(R) - API 30
Emulator Version : 31.2.6-8100890
Additional information
Include screenshots if they would be useful in clarifying the problem.
This is my Test code:
This is the error notification:
Here is the error description:
Task 3.4
add onClick on the XML.
**I am try add on click in my cancel button but I when I write where is the fun, doesn't find the class? **
This is my button code
<Button
android:id="@+id/cancel_button"
style="?attr/materialButtonOutlinedStyle"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="@dimen/side_margin"
android:onClick="@{() -> flavorFragment.cancelOrder()}"
android:text="@string/cancel"
app:layout_constraintEnd_toStartOf="@id/next_button"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="@id/next_button"
android:onClick="@{() -> flavorFragment.cancelOrder()}" flavorFragment has a red line , Ive checked , my fragment name is correct, in my nav_graph.xml is correct.
I dont know where is the issue
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.
In which task and step of the codelab can this issue be found?
Steo 2
Describe the problem
In code example instead of
setContentView(R.layout.main_activity)
it should be
setContentView(R.layout.activity_main)
Steps to reproduce?
In which task and step of the codelab can this issue be found?
STEP 3
This is the Cupcake app. This is the 4 starter project with a error and no way to import it!
I am not doing anymore Android studio until you fix your projects.
Describe the problem
see the screen shots. what is red has no way to import, so what am I supposed to do? Can you add it? I have other emails with other started projects I can't do because they are full of errors!
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.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-shared-viewmodel#8
In which task and step of the codelab can this issue be found?
Task 9
<data>
<variable
name="startFragment"
type="com.example.cupcake.StartFragment" />
</data>
Describe the problem
Is passing Fragment to the binding layout the best practice ?
In which task and step of the codelab can this issue be found?
step 9
Describe the problem
in the codelab, the sentence,
"That means the class, properties, or methods or not being used at the moment, but they will be! "
should be
"That means the class, properties, or methods are not being used at the moment, but they will be! "
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.
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-navigation-backstack#4
In which task and step of the codelab can this issue be found?
In Send the order
-> step 6.
Describe the problem
In getQuantityString(R.string.cupcakes, 1, 1)
the resources id shouldn't be R.string.cupcakes
, it should be R. plurals.cupcakes
In which task and step of the codelab can this issue be found?
page#5 AND solution code
Describe the problem
tests fail to accomplish even when I use the solution code.
For some reason it fails in InstantTaskExecutorRule part. When checking documentation, it says it is deprecated. I am not sure whether it is related to update in Android Studio that makes it fail.
> Task :app:compileDebugAndroidTestKotlin FAILED
e: D:\Downloads\Android Studio Projects\android-basics-kotlin-cupcake-app-starter\android-basics-kotlin-cupcake-app-starter\app\src\androidTest\java\com\example\cupcake\model\ViewModelTests.kt: (3, 36): Unresolved reference: testing
e: D:\Downloads\Android Studio Projects\android-basics-kotlin-cupcake-app-starter\android-basics-kotlin-cupcake-app-starter\app\src\androidTest\java\com\example\cupcake\model\ViewModelTests.kt: (15, 35): Unresolved reference: InstantTaskExecutorRule
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugAndroidTestKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 25s
54 actionable tasks: 7 executed, 47 up-to-date
Steps to reproduce?
Follow the steps of CodeLab
Versions
Android Studio version: 2021.1.1. Patch 2
API version of the emulator: API32
Additional information
Include screenshots if they would be useful in clarifying the problem.
URL of codelab
https://github.com/google-developer-training/android-basics-kotlin-cupcake-app.git
In which task and step of the codelab can this issue be found?
StartFragment.kt
Describe the problem
private val sharedViewModel: OrderViewModel by activityViewModels()
After inserting this line of code into each fragment as instructed, Android Studio does not recognize the activityViewModels() even after import. The error message reads:
Type mismatch: inferred type is ViewModel but OrderViewModel was expected
Steps to reproduce?
Versions
Android Studio version: arctic fox 2020.3.1 Patch 3
API version of the emulator: 28
Additional information
Include screenshots if they would be useful in clarifying the problem.
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.