Sam
06/15/2021, 3:52 AMAtomicInt
Documentation:
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.native.concurrent/-atomic-int/
My implement in Gradle:
org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.31
so Which libraries I should implement in project?Android75
06/15/2021, 5:07 AMEder Sanchez
06/15/2021, 6:40 AMWhy enter twice?
``````Will Nixon
06/15/2021, 3:27 PMSudhir Singh Khanger
06/15/2021, 5:41 PMJrichards1408
06/16/2021, 9:07 AM/ApplicationExtensions.kt: (8, 50): Unresolved reference: preferencesDataStore
code below:
import android.content.Context
import androidx.datastore.core.DataStore
import java.util.prefs.Preferences
// At the top level of your kotlin file:
val Context.dataStore: DataStore<Preferences> by preferencesDataStore(name = "settings")
In my gradle :
implementation("androidx.datastore:datastore-preferences:1.0.0-beta01")
juliocbcotta
06/16/2021, 1:39 PMIrene Serrano
06/16/2021, 8:40 PMSlackbot
06/17/2021, 9:15 AMKV
06/17/2021, 1:51 PMBagadeshkumar R
06/17/2021, 4:22 PMBarry Fawthrop
06/17/2021, 4:33 PMBradleycorn
06/17/2021, 8:24 PMjacoco
since updating Android Studio to version 4.2.1?
First I could not run unit tests at all, they would error with class not found errors. I was able to resolve that by excluding jdk internal classes (jacoco.excludes = ['jdk.internal.*']
). But now my coverage reports show 0% coverage, and I get a bunch of build output messages saying that “execution data for class xyz does not match”. I cant’ figure out how to solve that one?
It seems to be something in the AGP. If I roll the AGP back to v4.1.3 everything works fine. But as soon as I update to 4.2.0 suddenly I get 0% in my coverage report along with the “execution data for class…” warnings in the build output.Irene Serrano
06/17/2021, 10:16 PMlateinit property series has not been initialized
error. I don't really know what a good work around would be, any advice would be helpful? Thanks
To give background, I am trying to create a line graph using GraphView library
// create a new data series
lateinit var series: LineGraphSeries<DataPoint>
// link activity to layout view
val graph: GraphView = findViewById(R.id.line_chart)
// try to read and save data into series
val minput = InputStreamReader(assets.open("tester_data_CSV.csv"))
val reader = BufferedReader(minput)
var line: String
var x: Double
var y: Double
while (reader.readLine().also { line = it } != null) {
val row: List<String> = line.split(",")
x = row[0].toDouble()
y = row[1].toDouble()
// add data to series, unsure what the last element is for
series.appendData(DataPoint(x,y),true, 100)
}
// add series to graph
graph.addSeries(series)
haris mehmood
06/18/2021, 11:45 AMbinding?.bottomAppBar?.setupWithNavController(findNavController(R.id.nav_host))
but whenever i tab to any item on bottomBar its calling api again againvapoyan
06/18/2021, 2:08 PMprivate var socket: DatagramSocket = ....
fun startListening() {
while (socket != null) {
socket?.receive(packet) // we are blocked here untill we receive packet
}
}
How I can implement this with coroutines, so it's running async and not blocking ?Aniket Khajanchi
06/19/2021, 1:34 PMeygraber
06/20/2021, 7:36 PMmario
06/21/2021, 10:17 AMAndré Thiele
06/22/2021, 12:19 PMZakayo Thuku
06/22/2021, 12:54 PMFAILURE: Build failed with an exception.
* What went wrong:
com/android/build/gradle/AppExtension
> com.android.build.gradle.AppExtension
* Exception is:
java.lang.NoClassDefFoundError: com/android/build/gradle/AppExtension
at com.guardsquare.dexguard.gradle.DexGuardPlugin.apply(DexGuardPlugin.kt:47)
at com.guardsquare.dexguard.gradle.DexGuardPlugin.apply(DexGuardPlugin.kt:27)
....
Caused by: java.lang.ClassNotFoundException: com.android.build.gradle.AppExtension
... 195 more
FunkyMuse
06/22/2021, 2:05 PMFatal Exception: java.lang.IllegalArgumentException: saveBackStack("11cd317d-581d-457d-b8b3-167e3461edae") must be self contained and not reference fragments from non-saved FragmentTransactions. Found reference to fragment HealthFragment(categoryActionId=2131362017) in BackStackEntry{2e799a4 11cd317d-581d-457d-b8b3-167e3461edae} that were previously added to the FragmentManager through a separate FragmentTransaction.
Akash Amin
06/22/2021, 5:16 PMChristy Jacob
06/22/2021, 6:19 PMrepositories {
maven {
url "<https://s01.oss.sonatype.org/content/repositories/snapshots/>"
}
}
I then add my dependency
dependencies {
implementation("io.appwrite:sdk-for-android:0.0.0-SNAPSHOT")
}
Now I try to sync my Gradle files and I'm faced with this error.
Failed to resolve: com.github.franmontiel:PersistentCookieJar:v1.0.1
This is in fact a transitive dependency from my library (https://github.com/appwrite/sdk-for-android/blob/main/library/build.gradle#L71)
I'm now forced to add the jitpack maven repo to my example app as well, after which the error disappears.
repositories {
maven {
url "<https://s01.oss.sonatype.org/content/repositories/snapshots/>"
}
maven { url "<https://jitpack.io>" }
}
Is there a way to avoid adding this repository ?
My library's pom file already contains this dependency. (https://s01.oss.sonatype.org/content/repositories/snapshots/io/appwrite/sdk-for-android/0.0.0-SNAPSHOT/sdk-for-android-0.0.0-20210617.055649-2.pom).
Is there a way for gradle to automatically fetch this dependency without me having to add the jitpack repository ?
I would not expect my end users to add an additional repository.
Thank you for your help 🙂Lilly
06/22/2021, 7:18 PMPedro Azevedo
06/22/2021, 11:05 PMharis mehmood
06/23/2021, 10:15 AMJoshua
06/23/2021, 2:43 PMeschrag
06/23/2021, 3:21 PMBradleycorn
06/23/2021, 8:30 PMall-open
plugin, and define annotations in debug and release sourceSets so that annotated classes become open in debug builds, but final in release builds? This is the solution we’ve been using for some time, and it works, no question. But it’s not perfect, because what we really want is for the classes to only be open when running tests, but instead they are open anytime you are doing a debug build, whether for tests or otherwise. I know mockito introduced “inline-mock-maker” awhile back, and at the time it didn’t work with Robolectric. Is that still the case? Is there some other “new and improved” way to keep classes as final but allow them to be mocked in unit tests?