Guilherme Lima Pereira
05/05/2021, 8:42 PMNumberFormat.getCurrencyInstance
).
Learning about some changes from JDK 8 to JDK 11, I found that on JDK 9 they’ve enhanced some things related to Locale. One of the things is the usage of CLDR.
The issue with CLDR
is that is uses NBSP
instead of normal whitespace. The problem with NBSP
is that is not straightforward for the developers to add it during unit tests.
I tried to solve it by adding -Djava.locale.providers=COMPAT
on gradle.properties
(org.gradle.jvmargs
), but it keeps using NBSP
😢
Does anyone has suffered with it or have any idea how to address this issue?louiscad
05/06/2021, 10:23 AMChris Fillmore
05/06/2021, 2:41 PMLifecycleObserver
.
The Kotlin examples here use `@OnLifecycleEvent`: https://developer.android.com/topic/libraries/architecture/lifecycle#lc
However, this page (Java examples) says that annotations will be deprecated: https://developer.android.com/reference/kotlin/androidx/lifecycle/Lifecycle , and instead I should implement DefaultLifecycleObserver
What is the correct practice here? Thank you!Adam Powell
05/06/2021, 2:43 PMbaxter
05/07/2021, 4:07 AMcollect { }
. His issue was that the AS was expecting him to add the @InternalCoroutinesApi
annotation, and it also required he add in the FlowCollector
object implementation directly. At first I didn't know what happened, until he showed me the source code of the collect
function he was calling. Turned out it was the collect
function from the Flow.kt
file. I asked if he had the option to do the auto-import for the extension function collect
, but he didn't. I tried just typing out the collect
function out without auto-complete, and saw this happening on my machine as well. This confused my teammate who is learning Coroutines and Flows, but I'm curious if anyone else has run into this either personally or with teammates.Belmin Began
05/07/2021, 12:37 PMMark
05/07/2021, 2:40 PMCoroutineStart.Default
, doesn’t work sometimes when using an empty buffer Channel
and receiveAsFlow
(where an event is being offered instead of sent). CoroutineStart.Undispatched
does seem to work however.
I’m assuming this is because the launched coroutine needs to have executed the collect coroutine before an event is offered to the channel, in order to receive it.
So, is using CoroutineStart.Undispatched
the correct approach, or should I be using a buffered channel instead?Anshulupadhyay03
05/08/2021, 10:09 AMRemon Shehata
05/09/2021, 2:05 PMGabriele Rugani
05/09/2021, 8:34 PMRuntime JAR files in the classpath should have the same version. These
files were found in the classpath:
and
w: Consider providing an explicit dependency on kotlin-reflect 1.5 to
prevent strange errorsw: Some runtime JAR files in the classpath have
an incompatible version. Consider removing them from the classpath
By inspecting the dependendencies: one library use 1.3 , one 1.4 and so on , and for last but not least I have just update my project to 1.5 version .. Sure I can bring back the version to 1.4, but there are other library set to 1.3.
In which way kotlin-reflect could resolves the issue ? I provided an esplicit dependency on kotlin-reflect, but the warning still there..
Also some google's libraries However is not already updated to 1.5.0, for instance:
--- com.android.tools.analytics-library:tracker:27.2.0
| | +--- com.android.tools:annotations:27.2.0
| | +--- com.android.tools:common:27.2.0 (*)
| | +--- com.android.tools.analytics-library:protos:27.2.0 (*)
| | +--- com.android.tools.analytics-library:shared:27.2.0 (*)
| | +--- com.google.protobuf:protobuf-java:3.10.0
| | +--- com.google.guava:guava:28.1-jre (*)
| | \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31 (*)
What could happen if I would use different libraries with different kotlin version ?
Do you update your project's kotlin language's version only when all the imported libraries are updated ?
For instance this is the dependendencies of the old lifecycle-livedata-ktx:2.2.0, in an official libraries there are two different version of kotlin-stlib 1.3.5 and 1.4:
| | | | \--- androidx.lifecyclelifecycle livedata ktx2.2.0
| | | | +--- org.jetbrains.kotlinkotlin stdlib1.3.50 -> 1.5.0 (*)
| | | | +--- org.jetbrains.kotlinxkotlinx coroutines core1.3.0 -> 1.4.1
| | | | | \--- org.jetbrains.kotlinxkotlinx coroutines core jvm1.4.1
| | | | | +--- org.jetbrains.kotlinkotlin stdlib1.4.0 -> 1.5.0 (*)
| | | | | \--- org.jetbrains.kotlinkotlin stdlib common1.4.0 -> 1.5.0
| | | | +--- androidx.lifecyclelifecycle livedata2.2.0 (*)
| | | | \--- androidx.lifecyclelifecycle livedata core ktx2.2.0
| | | | +--- org.jetbrains.kotlinkotlin stdlib1.3.50 -> 1.5.0 (*)
| | | | \--- androidx.lifecyclelifecycle livedata core2.2.0 (*)Please forgive all these questions
rkeazor
05/10/2021, 2:24 AMorg.jetbrains.kotlin:kotlin-stdlib-jdk7
Equilat
05/10/2021, 7:57 AMstruct DefaultButton: View {
var body: some View {
Button("Button"){}
.buttonStyle(ButtonDefaultStyle())
}
}
My style is in an external class.
struct ButtonDefaultStyle: ButtonStyle {
func makeBody(configuration: Configuration) -> some View {
configuration.label
.frame(width: 100, height: 40)
.foregroundColor(Color( colorLiteral(red: 1, green: 1, blue: 1, alpha: 1)))
.background(configuration.isPressed ? Color( colorLiteral(red: 0.1254901961, green: 0.4666666667, blue: 0.4235294118, alpha: 1)) : Color( colorLiteral(red: 0.1411764706, green: 0.6784313725, blue: 0.5529411765, alpha: 1)))
.clipShape(RoundedRectangle(cornerRadius: 50))
.font(Font.custom("EuclidSquare-Medium", size: 16))
}
}
The best would be to be able to override a style by another style or by an attribute (Button().{}.style1(...).style2(...).color(...)...
Is there a way to do something similar in Compose ?
If not, did I misunderstood Compose philosophy or is it just something currently lacking ?L.C
05/10/2021, 12:41 PMu
and U
tag unsigned literals does not seems to work for me as well. It said “Type of the constant expression cannot be resolved. Please make sure you have the required dependencies for unsigned types in the classpath”. Hope to get a hint, thanks in advance!jaran
05/10/2021, 12:50 PMplugins {
id 'org.jetbrains.kotlin.android' version '1.4.30'
}
gives me the following error:Mohan Babu Malairaj
05/10/2021, 4:36 PMeygraber
05/10/2021, 10:12 PMursus
05/11/2021, 12:20 AMkokeroulis
05/11/2021, 2:33 PMsystem
storage is now 25GB
while yesterday it was 14GB
.
Do you know if its possible to find any remaining trace files and remove them? This is a real device, pixel 4.Chetan Tuteja
05/12/2021, 7:02 AMVitaliy Zarubin
05/12/2021, 10:07 AMSushruth Nagaraj
05/12/2021, 12:25 PMursus
05/12/2021, 11:31 PMChetan Tuteja
05/13/2021, 6:54 AMsolidogen
05/13/2021, 7:34 AMSushruth Nagaraj
05/13/2021, 8:12 AMTower Guidev2
05/13/2021, 9:27 AMKaran Sharma
05/13/2021, 11:44 AMnatario1
05/13/2021, 3:10 PMinternal fun interface Action<T: Any> {
val id: String get() = hashCode().toString()
fun execute(): Result<T>
}
fails on Android with: com.android.tools.r8.errors.b: Method name '<get-id>' in class '...$reload$1$1$2' cannot be represented in dex format.
Does anyone know if this is a Kotlin or R8 issue?Sushruth Nagaraj
05/13/2021, 6:48 PMChetan Tuteja
05/14/2021, 6:54 AM