google-developer-training / android-basics-kotlin-forage-app Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
When I start Testing my app I face this problem:
"Run Android instrumented tests using Gradle" option was ignored because this module type is not supported yet.
I tried to change the versions of the implementations and still not fixed and when I disabled "Run android instrumented tests using gradle" the error doesn't show again because the tests are not passing at all
Any solution !! ( I tried the app by my self and it's working)
page: link
typo in step 1:
private val viewModel: ForageableViewModel by activityViewModels {
ForageableViewModelFactory(
(activity?.application as BaseApplication).database.foragableDao()
)
}
foragableDao should be forageableDao
Dear Madam or Sir,
I am writing regarding the Quiz of this pathway (Use Room for data persistence), not the Project.
The reason I am using the Project Mistake Reporting System is because I could not find an option to report a mistake through the Quiz UI.
Question 3 in the Quiz asks why we need to use 'synchronized' when creating a database.
According to the attached screenshot from the codelab, the correct answers would be the first 2 options:
However, this is not the case in the Quiz.
According to the Quiz, the correct answers are:
I triple-checked the question, and I am pretty sure I am not required to select the FALSE answers.
What am I missing here?
Your help would be very much appreciated.
Thank you,
Ray T.
Dear Experts,
In step 4 at codelab, It's said that " tableName = 'forageable_database' " . Could it be typo here ? Maybe table name can be "forageable" only.
1-Annotate the class using @Entity with the table name "forageable_database".
In fact, the comment in Forageable.kt explains it.
/**
* Forageable entity to be stored in the forageable_database.
*/
private val viewModel: ForageableViewModel by activityViewModels {
ForageableViewModelFactory(
(activity?.application as BaseApplication).database.foragableDao()
)
}
->
private val viewModel: ForageableViewModel by activityViewModels {
ForageableViewModelFactory(
(activity?.application as BaseApplication).database.forageableDao()
)
}
URL of codelab
In which task and step of the codelab can this issue be found?
Describe the problem
Tutorial instruction is not clear.
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.
After lunching the app in Android Studio, I got a suggested Upgrades:
. Upgrade Gradle version to 7.3.3
. Upgrade Gradle plugins
. Upgrade AGP dependency from 4.1.1 to 7.2.1
I have Done that, then when I tried to Build the project I got an error.
then I searched for a solution I found this:
Then I got another Error:
My SDK versions:
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-project-forage
In which task and step of the codelab can this issue be found?
Step 5
Describe the problem
Tests do not run. Test Results show
"Run Android instrumented tests using Gradle" option was ignored because this module type is not supported yet.
Steps to reproduce?
Run any test from PersistenceInstrumentationTests
Versions
Android Studio version: Chipmunk 2021.2.1 Patch 2
API version of the emulator: 31
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-project-forage#0
In which task and step of the codelab can this issue be found?
Step 5
Describe the problem
The delete button on AddForageableFragment causes the app to crash. Immediately after deleting the forageable (and navigating back to ForageableListFragment, the onViewCreated method of AddForageableFragment gets called again returning a null object for the observed data ( "selectedForageable" becomes null)
viewModel.getForageable(id).observe(viewLifecycleOwner, Observer {
forageable = selectedForageable
bindForageable(forageable)
})
Thus, unless you check for the null
if (selectedForageable != null) {
forageable = selectedForageable
bindForageable(forageable)
}
the app will crash. This behaviour is different from the Inventory App of a prior code lab:
https://developer.android.com/codelabs/basic-android-kotlin-training-update-data-room
In the Inventory App, the onViewCreated method of ItemDetailFragment does not get called after deleting the item so there's no need to check for null on selectedItem. I suspect it has to do with the differences in navigation code between the two apps and I would like to know why.
Steps to reproduce?
delete any forageable
Versions
Android Studio version: Chipmunk 2021.2.1 Patch 2
API version of the emulator: 31
Additional information
Include screenshots if they would be useful in clarifying the problem.
Initial build is failing and it's recommending to upgrade the gradle wrapper.
(activity?.application as BaseApplication).database.foragableDao()
typo in "forageableDao"
Hi
I've completed Forage project step1 -5, but strugging to run the tests in step 6 of the Forage app project on both emulator (Pixel 5 API30) and physical device (pixel 6 pro API33).
Whenever I try to right click and run the PersistenceInstrumentationTests, the existing app that had been running on the device would crash and when I try to re-open the app, I'd get a blank screen. No error message thrown in Android Studio. See screenshot attached
This is the same regardless of whether I'm running the test in the original starter app with no modifications or running in my own version of the completed project. Not sure what I'm doing wrong, but any help is appreciated. Thanks
This is what I see before running the test:
This is what I get after running the test:
Test result pasted here
01/13 18:59:30: Launching 'PersistenceInstrumen... (1)' on Pixel 4 API 29.
Running tests
Configure project :app
WARNING:The option setting 'android.experimental.testOptions.emulatorSnapshots.maxSnapshotsForTestFailures=0' is experimental.
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsDebug UP-TO-DATE
Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:mergeDebugResources UP-TO-DATE
Task :app:dataBindingGenBaseClassesDebug UP-TO-DATE
Task :app:dataBindingTriggerDebug UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:generateSafeArgsDebug UP-TO-DATE
Task :app:checkDebugAarMetadata UP-TO-DATE
Task :app:mapDebugSourceSetPaths UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugMainManifest UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:processDebugManifestForPackage UP-TO-DATE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:preDebugAndroidTestBuild SKIPPED
Task :app:compileDebugAndroidTestAidl NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsDebugAndroidTest UP-TO-DATE
Task :app:dataBindingMergeGenClassesDebugAndroidTest UP-TO-DATE
Task :app:processDebugAndroidTestManifest UP-TO-DATE
Task :app:compileDebugAndroidTestRenderscript NO-SOURCE
Task :app:generateDebugAndroidTestResValues UP-TO-DATE
Task :app:generateDebugAndroidTestResources UP-TO-DATE
Task :app:mergeDebugAndroidTestResources UP-TO-DATE
Task :app:dataBindingGenBaseClassesDebugAndroidTest UP-TO-DATE
Task :app:generateDebugAndroidTestBuildConfig UP-TO-DATE
Task :app:checkDebugAndroidTestAarMetadata UP-TO-DATE
Task :app:mapDebugAndroidTestSourceSetPaths UP-TO-DATE
Task :app:processDebugAndroidTestResources UP-TO-DATE
Task :app:mergeDebugShaders UP-TO-DATE
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets UP-TO-DATE
Task :app:compressDebugAssets UP-TO-DATE
Task :app:processDebugJavaRes NO-SOURCE
Task :app:checkDebugDuplicateClasses UP-TO-DATE
Task :app:desugarDebugFileDependencies UP-TO-DATE
Task :app:mergeExtDexDebug UP-TO-DATE
Task :app:mergeLibDexDebug UP-TO-DATE
Task :app:mergeDebugJniLibFolders UP-TO-DATE
Task :app:mergeDebugNativeLibs NO-SOURCE
Task :app:stripDebugDebugSymbols NO-SOURCE
Task :app:validateSigningDebug UP-TO-DATE
Task :app:writeDebugAppMetadata UP-TO-DATE
Task :app:writeDebugSigningConfigVersions UP-TO-DATE
Task :app:mergeDebugAndroidTestShaders UP-TO-DATE
Task :app:compileDebugAndroidTestShaders NO-SOURCE
Task :app:generateDebugAndroidTestAssets UP-TO-DATE
Task :app:mergeDebugAndroidTestAssets UP-TO-DATE
Task :app:compressDebugAndroidTestAssets UP-TO-DATE
Task :app:processDebugAndroidTestJavaRes NO-SOURCE
Task :app:mergeDebugAndroidTestJniLibFolders UP-TO-DATE
Task :app:mergeDebugAndroidTestNativeLibs NO-SOURCE
Task :app:javaPreCompileDebugAndroidTest
Task :app:checkDebugAndroidTestDuplicateClasses UP-TO-DATE
Task :app:desugarDebugAndroidTestFileDependencies UP-TO-DATE
Task :app:mergeExtDexDebugAndroidTest UP-TO-DATE
Task :app:mergeLibDexDebugAndroidTest UP-TO-DATE
Task :app:validateSigningDebugAndroidTest UP-TO-DATE
Task :app:writeDebugAndroidTestSigningConfigVersions UP-TO-DATE
Task :app:processDebugResources
Task :app:kaptGenerateStubsDebugKotlin UP-TO-DATE
Task :app:kaptDebugKotlin UP-TO-DATE
Task :app:compileDebugKotlin UP-TO-DATE
Task :app:compileDebugJavaWithJavac UP-TO-DATE
Task :app:mergeDebugJavaResource UP-TO-DATE
Task :app:bundleDebugClassesToCompileJar
Task :app:dexBuilderDebug
Task :app:mergeProjectDexDebug UP-TO-DATE
Task :app:packageDebug
Task :app:createDebugApkListingFileRedirect UP-TO-DATE
Task :app:kaptGenerateStubsDebugAndroidTestKotlin
Task :app:kaptDebugAndroidTestKotlin
Task :app:compileDebugAndroidTestKotlin
Task :app:compileDebugAndroidTestJavaWithJavac
Task :app:mergeDebugAndroidTestJavaResource UP-TO-DATE
Task :app:dexBuilderDebugAndroidTest UP-TO-DATE
Task :app:mergeProjectDexDebugAndroidTest UP-TO-DATE
Task :app:packageDebugAndroidTest UP-TO-DATE
Task :app:createDebugAndroidTestApkListingFileRedirect UP-TO-DATE
Connected to process 8397 on device 'emulator-5554'.
Task :app:connectedDebugAndroidTest
URL of codelab
https://developer.android.com/codelabs/basic-android-kotlin-training-project-forage?hl=en#3
In which task and step of the codelab can this issue be found?
the code Google Development team has a error on the viewModelScope out of nowhere when I downloaded the project and I can't clear it
Describe the problem
See screenshot....
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.
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.