Slackbot
04/27/2021, 2:47 AMursus
04/27/2021, 3:02 AMforEach
createProcessors.forEach { it.process(db) }
Error: Call requires API level 24 (current min is 21): java.lang.Iterable#forEach [NewApi]
createProcessors.forEach { it.process(db) }
~~~~~~~
That can't be right, no?tateisu
04/27/2021, 5:26 AMCheolho Jeon
04/27/2021, 7:48 AMimplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.31"
and as a result it seems like I'm suddenly exceeding 64k method count and required to use multidex. Is it expected? I thought only several, used methods will be added to my final binary.Remy Benza
04/27/2021, 12:18 PMHovhannes
04/27/2021, 2:04 PMMark
04/27/2021, 2:55 PMRecyclerView
scroll position is being nondeterministically ‘forgotten’ due to the adapter being updated via the collection of a StateFlow
(in `Fragment.onCreateView()`:
val myAdapter = // create it
viewModel.itemsFlow.collectInViewScope(this) { items ->
myAdapter.setItems(items)
}
recyclerView.adapter = myAdapter
As a workaround (which seems to work), I just delay setting the adapter until the first search results come in:
viewModel.itemsFlow.collectInViewScope(this) { items ->
myAdapter.setItems(items)
with(recyclerView) {
if (adapter == null) {
adapter = myAdapter
}
}
}
However, this feels like a hack. What is the correct way to collect
adapter items and update the adapter so that the scroll position is not lost (when returning from a downstream fragment)?Ravi
04/28/2021, 7:07 AMVivek Modi
04/28/2021, 10:54 AMd*ata class Customer(val item: int,val name : String)
.* i want to pass through bundle. val bundle = Bundle()
but i didn't get which one i used putParcelable or something else. bundle.*putParcelable("customer, Customer(1,"X")")*
. It giving error Customer is not parcelableSlackbot
04/28/2021, 6:49 PMmittapalli hareesh
04/29/2021, 4:41 AMERROR: Failed to fetch maven artifact org.robolectric:android-all:9-robolectric-4913185-2
11:09:22 2021-04-28T11:09:21.613+0530 [DEBUG] [TestEventLogger] java.util.concurrent.ExecutionException: java.net.ConnectException: Operation timed out (Connection timed out)
due to this all my unit-test cases are failing & finally build failing. Can anyone help how to resolve this issue ? Similar Stackoverflow ticket is https://stackoverflow.com/questions/60710693/robolectric-fails-to-download-connection-time-outVivek Modi
04/29/2021, 3:07 PMHey! well done men
. How can i get substring done men
in kotlin. Anyone knows the easiest wayRaed Ghazal
04/29/2021, 10:36 PMaravind
04/30/2021, 6:47 AMSaiedmomen
04/30/2021, 7:15 AMSocheat KHAUV
04/30/2021, 4:44 PMRavi
05/01/2021, 8:39 PM15
and working fine in stable version of android studio, can anyone help
Script 'xxxxxxx/reactNative/node_modules/react-native/react.gradle' line: 99
* What went wrong:
A problem occurred evaluating script.
> Cannot run Project.afterEvaluate(Closure) when the project is already evaluated.
AJIBOLA ODUJOLE
05/02/2021, 11:05 AMprivate fun signIn() {
val email = findViewById<TextInputEditText>(R.id.email_edit_text)
val password = findViewById<TextInputEditText>(R.id.password_edit_text)
val signInButton = findViewById<MaterialButton>(R.id.next_button)
signInButton.setOnClickListener(){
if (email.toString().isEmpty() || password.toString().isEmpty()){
Toast.makeText(this, "Email or Password is not Provided", Toast.LENGTH_SHORT).show()
} else {
if (email.toString() == "<mailto:ajibs@gmail.com|ajibs@gmail.com>" && password.toString() == "234567"){
val intent = Intent(this, ViewActivity::class.java)
startActivity(intent)
} else {
Toast.makeText(this, "Wrong email or password", Toast.LENGTH_LONG).show()
}
}
}
}
Hello everyone,
A newbie on this streets, I have login screen I created It's failing to go to the next screen. Please feedback on the code block. Its output is always wrong email or passwordmohamadreza jafarzade
05/03/2021, 9:07 AMMohan Babu Malairaj
05/03/2021, 10:12 AMSlackbot
05/04/2021, 1:11 PMVivek Modi
05/04/2021, 1:31 PMval index = "Hey! How are you men? How you doing"
i want to search you doing from the above string, but i want y index from the word you. I did some code to find index but I am unable to find it.
fun main(vararg args: String) {
val inputString = "Hey! How are you men? How you doing"
val regex = "you doing".toRegex()
val match = regex.find(inputString)!!
println(match.value)
println(match.range)
}
iamthevoid
05/04/2021, 2:23 PME/FirebaseCrashlytics: Error handling uncaught exception
java.util.concurrent.TimeoutException
at com.google.firebase.crashlytics.internal.common.Utils.awaitEvenIfOnMainThread(Utils.java:122)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController.handleUncaughtException(CrashlyticsController.java:231)
at com.google.firebase.crashlytics.internal.common.CrashlyticsController$1.onUncaughtException(CrashlyticsController.java:153)
at com.google.firebase.crashlytics.internal.common.CrashlyticsUncaughtExceptionHandler.uncaughtException(CrashlyticsUncaughtExceptionHandler.java:54)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1073)
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:1068)
at java.lang.Thread.dispatchUncaughtException(Thread.java:2187)
Added with firebase bom (27.1.0) and dependency com.google.firebase:firebase-crashlytics-ktx
. Checked that with emulator and physical device (both without internet issues on quick look). How can it be?Fares Othmane Mokhtari
05/04/2021, 9:55 PMubu
05/05/2021, 10:31 AMRoom
compiler when switching to Kotlin 0.1.5
?Felipe Passos
05/05/2021, 11:41 AMManoj
05/05/2021, 11:55 AMArrayList<String> arr = new ArrayList<>();
arr.add("1");
arr.add("2");
arr.add("3");
arr.add("4");
arr.add("5");
for (int i = 0; i < arr.size(); i++) {
if(i == 3) {
arr.remove(i);
} else {
System.out.println(arr.get(i) + "\n");
}
}
& I have converted the same code in Kotlin -
val arr = ArrayList<String>();
arr.add("1")
arr.add("2")
arr.add("3")
arr.add("4")
arr.add("5")
for (i in 0 until arr.size) {
if(i == 3) {
arr.removeAt(i)
} else {
println("Value ${arr.get(i)}")
}
}
bt it gives Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 4, Size: 4 but works in Java without exception... Anyone has any idea what's wrong here?Mark
05/05/2021, 1:01 PMkotlinOptions {
jvmTarget = "1.8"
}
Slackbot
05/05/2021, 3:18 PMtrevjones
05/05/2021, 6:55 PMCause 1: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.5.0.
Required by:
project :app
Caused by: org.gradle.api.GradleException: Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.5.0' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.5.0(junit5Api)]
...
Cause 2: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.5.0.
Required by:
project :app > project :appStartup
project :app > project :flow-ext
project :app > project :json-ext
project :app > project :retrofit-ext
project :app > project :session-data
Caused by: org.gradle.api.GradleException: Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.5.0' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.5.0(junitApi)]
trevjones
05/05/2021, 6:55 PMCause 1: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-test-junit:1.5.0.
Required by:
project :app
Caused by: org.gradle.api.GradleException: Module 'org.jetbrains.kotlin:kotlin-test-junit' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.5.0' also provided by [org.jetbrains.kotlin:kotlin-test-junit5:1.5.0(junit5Api)]
...
Cause 2: org.gradle.internal.resolve.ModuleVersionResolveException: Could not resolve org.jetbrains.kotlin:kotlin-test-junit5:1.5.0.
Required by:
project :app > project :appStartup
project :app > project :flow-ext
project :app > project :json-ext
project :app > project :retrofit-ext
project :app > project :session-data
Caused by: org.gradle.api.GradleException: Module 'org.jetbrains.kotlin:kotlin-test-junit5' has been rejected:
Cannot select module with conflict on capability 'org.jetbrains.kotlin:kotlin-test-framework-impl:1.5.0' also provided by [org.jetbrains.kotlin:kotlin-test-junit:1.5.0(junitApi)]
configurations.all {
resolutionStrategy.capabilitiesResolution
.withCapability("org.jetbrains.kotlin:kotlin-test-framework-impl:$kotlinVersion") {
val junit4 = candidates.find { (it.id as? ModuleComponentIdentifier)?.module == "kotlin-test-junit" }
val junit5 = candidates.find { (it.id as? ModuleComponentIdentifier)?.module == "kotlin-test-junit5" }
if(useJunit5) junit5?.let { select(it) }
else junit4?.let { select(it) }
}
}