Saket Poddar
03/12/2020, 9:40 AMmike.dev
03/12/2020, 3:47 PMOutOfMemoryError
exception.
It happens on the building phrase with this task generateDebugUnitTestStubRFile"
We have multiple modules, and OOM error occurs randomly
I can fix the issue by increasing the gradle max-heap size, but it’s not a good option because we ’re very close to the limit of the hardware.
So far, what I have tried are:
1. Update Gradle to 6.2.2
2. Tried to turn on/off grade worker API with `kapt.use.worker.api`& android.enableGradleWorkers
flags (they are off by now)
3. Play around with some testOptions flags (https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html), for example forkEvery, maxParallelForks. But I am not sure it would help, because the failure happens on the building phrase.
Here is the crash log:
Caused by: com.android.ide.common.workers.WorkerExecutorException: 1 exception was raised by workers:
java.lang.OutOfMemoryError: GC overhead limit exceeded
at com.android.ide.common.workers.ExecutorServiceAdapter.await(ExecutorServiceAdapter.kt:108)
at com.android.ide.common.workers.ExecutorServiceAdapter.close(ExecutorServiceAdapter.kt:118)
at <http://kotlin.io|kotlin.io>.CloseableKt.closeFinally(Closeable.kt:53)
The crash happened by this line of code. https://android.googlesource.com/platform/tools/base/+/studio-master-dev/build-system/gradle-core/src/main/java/com/android/build/gradle/internal/res/GenerateLibraryRFileTask.kt#120
It will be very appreciated if anyone of you would suggest any solution or direction to investigate.
Generate a heapdump is on my planarekolek
03/12/2020, 4:30 PMviewBinding
in Android Studio 3.6.1, with Gradle 6.2.2, Android Gradle plugin 3.6.1 and Kotlin Gradle plugin 1.3.70.
This code:
val binding = SomeLayoutBinding.bind(itemView)
produces this warning in the IDE:
Declaration has type inferred from a platform call, which can lead to unchecked nullability issues. Specify type explicitly as nullable or non-nullable.Even though, when I open the generated
SomeLayoutBinding.java
file, I see that it's annotated with `@NonNull`:
@NonNull
public static SomeLayoutBinding bind(@NonNull View rootView) {
Am I missing something here? Anybody else has this issue? Where would I even report it?Kulwinder Singh
03/13/2020, 5:54 AMval data: MutableMap<String, Any>
/..../
val client = data.get("MY_DATA") as Map<String, Any>//Unchecked cast: Any? to Map<String, Any>
android studio suggest to convert it to val client = data.get("MY_DATA") as *Map<*, *>*
What is difference between both?Colton Idle
03/13/2020, 9:43 AMJames K Williams
03/13/2020, 10:56 AMBruno_
03/14/2020, 12:33 PMby viewModels()
? tried to google creating view model manually
and kotlin by viewModels()
, couldn't find anything interestingJoshua
03/14/2020, 3:57 PMsetHomeAsUpIndicator
to display a drawer icon which is placed by default on the left side. Which function can I use to an icon on the right side of the toolbar?Jonny
03/14/2020, 9:48 PMColton Idle
03/15/2020, 2:00 AMShreyas Patil
03/15/2020, 8:56 AMjeff
03/15/2020, 10:15 PMObservable.zip(obsA, obsB) { a, b -> a + b }
instead of
Observable.zip(
obsA,
obsB,
BiFunction { a, b -> a + b }
)
?
I know how to write
SomethingCustom.zip(obsA, obsB) { a, b -> a + b }
but I'm asking if there's a best practice or well-known library or somethingJoey
03/15/2020, 10:54 PMAlmas Shagdarov
03/16/2020, 7:41 AMvs.thaakur
03/16/2020, 8:44 AMBaseTransientBottomBar
. But it is taking bottom Margin I want it to stick to bottom but it takes some default Bottom Margin.
I am using below code to remove the bottom margin
(view.layoutParams as MarginLayoutParams).setMargins(margin10, 0, margin10, 0)
Is there any way to remove the bottom margin?ritesh
03/16/2020, 1:55 PM@Parcelize
Any way, can i make use of typealias
and expect
and actual
without converting the domain pure kotlin module to android module?dave08
03/16/2020, 1:56 PMCoroutineWorker
uses launch
to run doWork
, does that mean that a crash can't be caught with a regular try/catch? Does a CoroutineExceptionHandler
need to be installed for that? If so, where?paulex
03/16/2020, 2:54 PMSlackbot
03/16/2020, 5:49 PMMarc Knaup
03/16/2020, 9:34 PMFunction…
is marked @FunctionalInterface
.
Is it supposed to work like I’m trying to use it or isn’t it? 🙂Lumeidagnacadja
03/16/2020, 10:12 PMOfir Bar
03/17/2020, 10:11 AMViewModel
.
I change their values one after another:
advertisementGoal.value = editModeInitialAdvertisement!!.goal
advertisementTargetUserType.value = editModeInitialAdvertisement!!.userTypeTarget
selectedExpertiseField.value = editModeInitialAdvertisement!!.expertiseField.id
Is this a race condition? or do LiveData
in the UI trigger onChange()
in order?tjohnn
03/17/2020, 10:26 AMdata class (
val message: String,
val callback: () -> Unit
)
Jabez Magomere
03/17/2020, 11:58 AMAlexanderkvamme
03/17/2020, 12:57 PMJoao Birk
03/17/2020, 8:26 PMitnoles
03/18/2020, 2:21 AMMadalin Valceleanu
03/18/2020, 8:20 AMOrhan Tozan
03/18/2020, 6:52 PMclass ViewModel {
val selectedColor: Flow<Color> = ...
fun onNewColorSelect(newColor: Color) {
...
}
}
How can the onNewColorSelect
method update the selectedColor flow? With Android, you would use MutableLiveData. How would you solve this problem with Flow?jiangxingbing
03/19/2020, 3:42 AMjiangxingbing
03/19/2020, 3:42 AMahulyk
03/19/2020, 8:30 AMAlexey Belkov [JB]
03/20/2020, 8:01 AMprivate top-level declarations are compiled to package-local declarations
jiangxingbing
03/20/2020, 12:05 PM