Forum Discussion
App crashes with "Didn't find class "androidx.window.WindowManager""-exception
- Jan 21, 2022
tscholze Glad to hear you got your project to build!
Sorry that you're facing issues with transforming our samples, but the good news is that your issue should be solved by updating to the newest version of TwoPaneLayout:
implementation 'com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha10'
Some of the older versions of TwoPaneLayout depend on older version of the Jetpack Window Manager library, and this can occasionally cause compatibility issues. We try to keep our own SDK dependencies updated in our samples, so you can refer here if you ever have doubts.
Also, I think there are still a few duplicate imports/imports without version numbers in your gradle.kts file - try pasting in the edited version below and let me know if that helps:
dependencies {
var koin_version = "3.1.5"
var navigation_version = "2.4.0-rc01"
var compose_version = "1.1.0-alpha06"
// Android
implementation "androidx.navigation:navigation-compose:$navigation_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
// Google
implementation 'com.google.android.material:material:1.5.0'
// JetBrains
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
// Flow layout
implementation 'com.google.accompanist:accompanist-flowlayout:0.22.0-rc'
// Microsoft
implementation 'com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha10'
implementation 'com.microsoft.device.dualscreen:windowstate:1.0.0-alpha1'
// Ktor
implementation("io.ktor:ktor-client-core:1.6.7")
implementation("io.ktor:ktor-client-cio:1.6.7")
implementation("io.ktor:ktor-client-serialization:1.6.7")
// Koin
implementation "io.insert-koin:koin-android:$koin_version"
implementation "io.insert-koin:koin-androidx-compose:$koin_version"
// Map
implementation("com.google.android.libraries.maps:maps:3.1.0-beta")
implementation("com.google.maps.android:maps-v3-ktx:2.2.0")
implementation("androidx.fragment:fragment-ktx:1.4.0")
// Testing
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}
tscholze Glad to hear you got your project to build!
Sorry that you're facing issues with transforming our samples, but the good news is that your issue should be solved by updating to the newest version of TwoPaneLayout:
implementation 'com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha10'
Some of the older versions of TwoPaneLayout depend on older version of the Jetpack Window Manager library, and this can occasionally cause compatibility issues. We try to keep our own SDK dependencies updated in our samples, so you can refer here if you ever have doubts.
Also, I think there are still a few duplicate imports/imports without version numbers in your gradle.kts file - try pasting in the edited version below and let me know if that helps:
dependencies {
var koin_version = "3.1.5"
var navigation_version = "2.4.0-rc01"
var compose_version = "1.1.0-alpha06"
// Android
implementation "androidx.navigation:navigation-compose:$navigation_version"
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling-preview:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation 'androidx.activity:activity-compose:1.4.0'
implementation 'com.google.android.material:material:1.5.0'
// JetBrains
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0'
// Flow layout
implementation 'com.google.accompanist:accompanist-flowlayout:0.22.0-rc'
// Microsoft
implementation 'com.microsoft.device.dualscreen:twopanelayout:1.0.0-alpha10'
implementation 'com.microsoft.device.dualscreen:windowstate:1.0.0-alpha1'
// Ktor
implementation("io.ktor:ktor-client-core:1.6.7")
implementation("io.ktor:ktor-client-cio:1.6.7")
implementation("io.ktor:ktor-client-serialization:1.6.7")
// Koin
implementation "io.insert-koin:koin-android:$koin_version"
implementation "io.insert-koin:koin-androidx-compose:$koin_version"
// Map
implementation("com.google.android.libraries.maps:maps:3.1.0-beta")
implementation("com.google.maps.android:maps-v3-ktx:2.2.0")
implementation("androidx.fragment:fragment-ktx:1.4.0")
// Testing
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_version"
debugImplementation "androidx.compose.ui:ui-tooling:$compose_version"
}