Comments (16)
Hmm that sounds to me like your Android project isn’t configured correctly. Does the example work for you?
from multi_screen_layout.
yes, example works perfectly but only in debug mode, might be that there is a problem on my chair regarding flutter build apk.
I even created only app using the lib but this as well run only in debug mode.
from multi_screen_layout.
I just tested and getInfoModel
is working fine for me in release mode, so unfortunately it seems to be something with your local environment.
from multi_screen_layout.
is there any additional configuration which should be performed for apk release in build.graddle?
`
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 29
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.mlscreentest2"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
`
from multi_screen_layout.
The only difference seems to be target/compile SDK 29 vs 28. I just tried 29 and it still worked for me. So I don’t know what the problem could be.
from multi_screen_layout.
I did changed build to 28 and afterwards I got this:
E/AndroidRuntime(21507): java.lang.AbstractMethodError: abstract method "void androidx.window.extensions.ExtensionInterface$ExtensionCallback.onDeviceStateChanged(androidx.window.extensions.ExtensionDeviceState)" E/AndroidRuntime(21507): at androidx.window.extensions.StubExtension.updateDeviceState(StubExtension.java:60) E/AndroidRuntime(21507): at androidx.window.extensions.SamsungExtensionImpl.updateDevicePosture(SamsungExtensionImpl.java:56) E/AndroidRuntime(21507): at androidx.window.extensions.SamsungExtensionImpl.access$000(SamsungExtensionImpl.java:37) E/AndroidRuntime(21507): at androidx.window.extensions.SamsungExtensionImpl$SamsungSidecarCallbackListener.onDeviceStateChanged(SamsungExtensionImpl.java:122) E/AndroidRuntime(21507): at android.view.WindowManagerGlobal.lambda$handleDeviceStateChangedEventIfNeedLocked$1$WindowManagerGlobal(WindowManagerGlobal.java:1063) E/AndroidRuntime(21507): at android.view.-$$Lambda$WindowManagerGlobal$t_FrAl7awC-2nUyIU7zWOtTY28M.run(Unknown Source:2) E/AndroidRuntime(21507): at android.os.Handler.handleCallback(Handler.java:883) E/AndroidRuntime(21507): at android.os.Handler.dispatchMessage(Handler.java:100) E/AndroidRuntime(21507): at android.os.Looper.loop(Looper.java:237) E/AndroidRuntime(21507): at android.app.ActivityThread.main(ActivityThread.java:8167) E/AndroidRuntime(21507): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(21507): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496) E/AndroidRuntime(21507): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
from multi_screen_layout.
@MisterJimson same issue :(
when i changed target/complie from 28->29 i got this:
Fatal Exception: java.lang.AbstractMethodError: abstract method "void androidx.window.sidecar.SidecarInterface$SidecarCallback.onDeviceStateChanged(androidx.window.sidecar.SidecarDeviceState)"
at androidx.window.sidecar.StubSidecarImpl.updateDeviceState(StubSidecarImpl.java:60)
at androidx.window.sidecar.SamsungSidecarImpl.updateDevicePosture(SamsungSidecarImpl.java:63)
at androidx.window.sidecar.SamsungSidecarImpl.access$000(SamsungSidecarImpl.java:44)
at androidx.window.sidecar.SamsungSidecarImpl$SamsungSidecarCallbackListener.onDeviceStateChanged(SamsungSidecarImpl.java:125)
at android.view.WindowManagerGlobal.lambda$handleDeviceStateChangedEventIfNeedLocked$1$WindowManagerGlobal(WindowManagerGlobal.java:986)
at android.view.-$$Lambda$WindowManagerGlobal$t_FrAl7awC-2nUyIU7zWOtTY28M.run(-.java:2)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7952)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
I ran debug it working fine but when i built apk and upload to firebase it crash and report this log
from multi_screen_layout.
You could try adding this to your build.gradle to ensure the library is set correctly.
implementation "androidx.window:window:1.0.0-alpha01"
from multi_screen_layout.
Yep i had tried from alpha01 to alpha09 . After changed i run example project in release mode first time it return error in previous comment, but after that app crash without log. Can y check for me?
I run in physical device zflip and flutter version 2.5.1
from multi_screen_layout.
androidx.window.WindowManager.registerDeviceStateChangeCallback (WindowManager.java:2)
arrow_right
com.jrai.multi_screen_layout.MultiScreenLayoutPlugin.setupWindowManager (MultiScreenLayoutPlugin.java:24)
com.jrai.multi_screen_layout.MultiScreenLayoutPlugin.onAttachedToActivity (MultiScreenLayoutPlugin.java:11)
error t got from firebase @MisterJimson
from multi_screen_layout.
@MisterJimson :( Can you help me fix this?
from multi_screen_layout.
I don't have a fold 1 or 2 anymore, so unfortunately its difficult for me to help. Will revisit when the Android WindowManager lib hits 1.0.0 stable.
from multi_screen_layout.
Can y update your lib to newest WindowManager. I cannot create WindowInfoRepository in FlutterPlugin because it not implement AppCompatActivity. So use to method channel in my app not use lib and it working because my MainActivity extends FlutterFragmentActivity
from multi_screen_layout.
Yep, I will give it a try when it hits 1.0.0 stable. There are a lot of changes from the current one, so its not simple.
from multi_screen_layout.
Tks you :D Hope the library will be finished soon
from multi_screen_layout.
@ducvu212 I just pushed version 3.0.0 which resolved the compile issues on my end.
from multi_screen_layout.
Related Issues (7)
- Surface Duo hinge angle doesn't update in real time when used with MultiScreenLayout
- MultiScreenInfo.surfaceDuoInfoModel.isSpanned = false while SurfaceDuoPlatformHandler.getIsSpanned() = true HOT 10
- Immediately crashes in release build for Samsung Galaxy Z Flip3 5G HOT 7
- Add a way to know when an app has been spanned from a particular widget HOT 9
- Use FoldingFeature instead of DeviceState
- support fold3? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multi_screen_layout.