Slackbot
10/11/2021, 10:37 AMShaheer Muzammil
10/11/2021, 2:30 PMvar dataList = emptyList()
fun suspend fetchData(){
dataList = repository.getData() //another suspend function
.map{/* some mapping logic */}
liveData.postValue(dataList)
}
I have this scenario and an empty list is being printed.spierce7
10/11/2021, 8:44 PMAshu
10/12/2021, 5:34 AMorg.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during file facade code generation
File being compiled: <file://D>:/........../FirebaseMessagingService.kt
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.com.intellij.openapi.diagnostic.DefaultLogger.error(DefaultLogger.java:53)
What is this error?Ashu
10/12/2021, 8:21 AM@Nullable
nor @NotNull
, what is it considered in Kotlin. Normally it would be allowed to pass nullable arguments but I have updated Kotlin version and now it is taking them as non-nullable arguments and throwing error. Did this change?Milan Vadhel
10/12/2021, 11:42 AMVivek Modi
10/12/2021, 2:51 PMshahroz
10/12/2021, 2:53 PMmemory leakage
?Se7eN
10/12/2021, 4:52 PMPermissionUtils
that takes care of checking/requesting permissions:
object PermissionUtils {
fun checkPermissions(context: Context, permissions: List<String>, listener: PermissionListener) {
// uses a library that checks for permissions and calls listener.onPermissionsGranted() or listener.onPermissionsDenied()
}
}
Now, to use the new activity result API, I'd have to register the contracts in each activity, which doesn't sound good because I have many activities and all of them would look like this:
class MyActivity : AppCompatActivity {
val imageFromGallery = registerForActivityResult(RequestMultiplePermissions()) {
...
}
val takePicture = registerForActivityResult(RequestMultiplePermissions()) {
...
}
val shareImage = registerForActivityResult(RequestMultiplePermissions()) {
...
}
}
Is it possible to incorporate this logic into the checkPermissions()
function itself?Lilly
10/12/2021, 5:02 PMKatarzyna
10/13/2021, 7:31 AMMohan Babu Malairaj
10/13/2021, 7:33 AMSlackbot
10/13/2021, 3:54 PMAndroid75
10/14/2021, 3:08 AMiamraghavawasthi
10/14/2021, 8:13 AMVivek Modi
10/14/2021, 9:38 AMenum class ConversationStatus(val status: String) {
OPEN("open"),
CLOSED("closed");
companion object {
private val mapByStatus = values().associateBy(ConversationStatus::status)
fun fromType(status: String): ConversationStatus {
return mapByStatus[status]
}
}
}
How can i avoid this ?Billy Newman
10/14/2021, 1:22 PMspierce7
10/14/2021, 7:56 PMplugins.withType<com.android.build.gradle.LibraryPlugin> { }
in Gradle Kotlin Script DSL?
I’m trying to configure multiple gradle modules via the gradle submodules
block in the root build.gradle.kts. I’ve never been able to figure out how to do this though.gilsonjuniorpro
10/14/2021, 9:14 PMOsip Fatkullin
10/15/2021, 11:37 AMThis library will be maintained until an official solution for DataStore encryption will be released by Google.
reactormonk
10/15/2021, 12:34 PMNone of the following functions can be called with the arguments supplied:
public/*package*/ constructor Module(loader: ClassLoader!) defined in java.lang.Module
public/*package*/ constructor Module(loader: ClassLoader!, descriptor: ModuleDescriptor!) defined in java.lang.Module
public/*package*/ constructor Module(layer: ModuleLayer!, loader: ClassLoader!, descriptor: ModuleDescriptor!, uri: URI!) defined in java.lang.Modulekotlin(NONE_APPLICABLE)
I'm not even sure how to debug that. Looks like the language server doesn't have all the source loaded?Nayan Gandhi
10/15/2021, 6:25 PMfun method(){}
). Kotlin based Apps won't complain about new method while Java based Apps will complain about implementing the new method added to the interface. Is there any thing we can do so that it's not a breaking change for Java based apps?Vivek Modi
10/15/2021, 10:38 PMreactormonk
10/17/2021, 9:28 AM> 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.
> Failed to stop service 'com.android.build.gradle.internal.errors.SyncIssueReporterImpl$GlobalSyncIssueService_4e280c73-f191-497b-9e82-c0aa147e7cbd'.
> Failed to find target with hash string 'android-30' in: /opt/android-sdk
I can't find the android support plugin in the settings, intellij version 2021.2.2
I ran
sdkmanager "platforms;android-30"
So the platform should be installed.Lukas K-G
10/18/2021, 6:52 AMSlackbot
10/18/2021, 8:02 AMRodrigo
10/18/2021, 1:17 PMPanicMonster
10/18/2021, 3:03 PMVivek Modi
10/19/2021, 8:25 AMfun main() {
val listOne = mutableListOf(2, 3)
listOne.add(0, 1)
println(listOne)
var listTwo = mutableListOf(2, 3)
listTwo = (mutableListOf(1) + listTwo).toMutableList()
println(listTwo)
}
what's the d/w both example?Fernando de Paula
10/19/2021, 12:15 PM