darkmoon_uk
02/28/2019, 12:11 AMRiccardo Montagnin
02/28/2019, 8:31 AMRiccardo Montagnin
02/28/2019, 9:36 AMtargets
, to place an android
clause including a sibling module that is an android app?
I have the current structure:
project
|- android-app
|- common
|- commonMain
|- iosMain
|- jvmMain
I would like to create some actual
implementations inside the android-app
module, which is an Android application module. How would I have to do?
Right now when I compile the Android app the jvmMain
is compiled, but I would like to provide some custom actual
implementations for the Android appRiccardo Montagnin
02/28/2019, 12:09 PMcommonTest
?CLOVIS
02/28/2019, 5:44 PMrobstoll
02/28/2019, 9:26 PMMarc Knaup
03/01/2019, 12:58 PMcommonMain/kotlin
is recognized as a source folder and androidMain/kotlin
is not?
The Gradle view in IntelliJ also doesn't list any Android source sets 😞
https://gist.github.com/fluidsonic/04f7b15c4bc5263cd5f82632697804a4jeremy
03/01/2019, 1:31 PMMarc Knaup
03/01/2019, 4:14 PMBino
03/01/2019, 5:09 PMlinkSharedCodeReleaseFrameworkIos
BUILD SUCCESSFUL in 1m 55s
There are only some functions in the commons modulepardom
03/02/2019, 2:02 PMRobert
03/03/2019, 12:39 PMlouiscad
03/03/2019, 6:40 PMandroidTest
are run as unit tests without instrumentation, making them fail (they are run on the computer without Android OS with no option to run it from an Android device/emulator).
Where should I put my instrumented tests, or how should I configure my module to get instrumentation back?manijshrestha
03/04/2019, 3:42 PMRiccardo Montagnin
03/05/2019, 9:14 AMandroidMain
dependencies into androidTest
? Should I just copy/paste them or is there a better method to do it, like a reference?Riccardo Montagnin
03/05/2019, 9:49 AMsuspend
funciton?
Let's consider this class
/**
* Allows the login of a user based on his private key.
*/
class PerformLoginUseCase internal constructor(private val repository: AuthenticationRepository){
/**
* Logs the user into the system using the given [authKey].
* @return the user data once the login has been successful.
*/
suspend operator fun invoke(authKey: PrivateKey): UserData {
return repository.login(authKey)
}
}
I have the following test
@Test
fun useCaseThrowsExceptionWhenRepositoryDoes() {
assertFailsWith(Throwable::class) {
coEvery { repository.login(any()) } throws Throwable()
GlobalScope.launch { performLogin(mockk()) }
}
}
While this should work properly, it fails with an assertionError
. I think the exception is not raised in time, so who should I do this?ribesg
03/05/2019, 10:23 AMsourceSets {
val commonMain by getting {
dependencies {
api("mygroup:mympplib:0.0.1-SNAPSHOT")
}
}
val androidMain by getting {
dependencies {
}
}
for (iosTarget in iosTargets) {
getByName("${iosTarget.name}Main") {
dependencies {
}
}
}
}
GarouDan
03/05/2019, 2:32 PM1.3.30-eap-11
version, but I’m receiving this error:
* What went wrong:
Plugin [id: 'org.jetbrains.kotlin.multiplatform', version: '1.3.30-eap-11'] was not found in any of the following sources:
- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.jetbrains.kotlin.multiplatform:org.jetbrains.kotlin.multiplatform.gradle.plugin:1.3.30-eap-11')
I’m trying to use this in my `build.gradle.kts`:
buildscript {
repositories {
maven { url = uri("<https://dl.bintray.com/kotlin/kotlin-eap>") }
...
dependencies {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.30-eap-11")
...
}
allprojects {
repositories {
maven {
url = uri("<https://dl.bintray.com/kotlin/kotlin-eap>")
content {
excludeGroup("Kotlin/Native")
}
}
...
Am I missing something?
Edit:
The error is happening here (in my root build.gradle.kts
file):
plugins {
kotlin("multiplatform") version "1.3.30-eap-11"
}
Marc Knaup
03/05/2019, 3:44 PMpardom
03/05/2019, 9:17 PMpardom
03/05/2019, 9:25 PMbdeg
03/05/2019, 10:04 PMjuliocbcotta
03/06/2019, 12:59 AM2019-03-05 21:46:22.422 25541-25541/br.com.youse.forms.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: <http://br.com.youse.forms.app|br.com.youse.forms.app>, PID: 25541
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{<http://br.com.youse.forms.app/br.com.youse.forms.samples.form.FormLoginActivity|br.com.youse.forms.app/br.com.youse.forms.samples.form.FormLoginActivity>}: java.lang.ClassNotFoundException: Didn't find class "br.com.youse.forms.samples.form.FormLoginActivity" on path: DexPathList[[zip file "/data/app/br.com.youse.forms.app-B2ycXZrm8-D79TrXtKX7Iw==/base.apk"],nativeLibraryDirectories=[/data/app/br.com.youse.forms.app-B2ycXZrm8-D79TrXtKX7Iw==/lib/x86, /system/lib, /vendor/lib]]
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "br.com.youse.forms.samples.form.FormLoginActivity" on path: DexPathList[[zip file "/data/app/br.com.youse.forms.app-B2ycXZrm8-
I did check if the Activity in the AndroidManifest is right and I could run the same :app
code switching the local mpp project to a published dep. I also can ran the unit tests from commonTest just fine.
Does anyone has ran into something like that? I uploaded my current work here https://github.com/BugsBunnyBR/forms-mpp-problem if anyone want to take a look...Diogo Ribeiro
03/06/2019, 1:27 PMRiccardo Montagnin
03/06/2019, 3:42 PMactual
classes for the android instrumented tests? Right now I'm putting them into androidTest
, but they are executed as unit tests. If I try running gradle checkConnected
I get the following error:
Expected object 'XYZ' has no actual declaration in module
How should I configure the project to have instrumented tests?Marc Knaup
03/06/2019, 4:52 PMNSInteger
is back 😢max.cruz
03/06/2019, 5:34 PM@property (readonly) double double;
@property (readonly) float float;
@property (readonly) int32_t int;
Apparently symbols generated by Kotlin Native aren’t compatible with Objective Civan.savytskyi
03/06/2019, 6:43 PM__attribute__((swift_name("Kotlinx_coroutines_core_nativeCoroutineDispatcher")))
@interface MainKotlinx_coroutines_core_nativeCoroutineDispatcher : MainKotlinAbstractCoroutineContextElement <MainKotlinContinuationInterceptor>
__attribute__((swift_name("Ktor_client_coreHttpClientEngineConfig")))
@interface MainKtor_client_coreHttpClientEngineConfig : KotlinBase
etc.
And it looks weird on Swift side to have smth like this public class UICoroutineContext: Kotlinx_coroutines_core_nativeCoroutineDispatcher
pardom
03/06/2019, 9:38 PMAny?
. Is this expected?pardom
03/06/2019, 9:40 PM