Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Z fold 2 build #5

Closed
kordek212 opened this issue Jan 7, 2021 · 16 comments
Closed

Z fold 2 build #5

kordek212 opened this issue Jan 7, 2021 · 16 comments

Comments

@kordek212
Copy link

While running apk with 1.0.1 lib it crashes with missing implementation medhod getInfoModel().
Is there any other dependency which should be included for galaxy fold device?

image

@MisterJimson
Copy link
Owner

Hmm that sounds to me like your Android project isn’t configured correctly. Does the example work for you?

@kordek212
Copy link
Author

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.

@MisterJimson
Copy link
Owner

I just tested and getInfoModel is working fine for me in release mode, so unfortunately it seems to be something with your local environment.

@kordek212
Copy link
Author

kordek212 commented Jan 7, 2021

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"
}

`

@MisterJimson
Copy link
Owner

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.

@kordek212
Copy link
Author

kordek212 commented Jan 7, 2021

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)

@ducvu212
Copy link

ducvu212 commented Sep 21, 2021

@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

@MisterJimson
Copy link
Owner

You could try adding this to your build.gradle to ensure the library is set correctly.

implementation "androidx.window:window:1.0.0-alpha01"

@ducvu212
Copy link

ducvu212 commented Sep 21, 2021

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

@ducvu212
Copy link

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

@ducvu212
Copy link

@MisterJimson :( Can you help me fix this?

@MisterJimson
Copy link
Owner

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.

@ducvu212
Copy link

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

@MisterJimson
Copy link
Owner

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.

@ducvu212
Copy link

Tks you :D Hope the library will be finished soon

@MisterJimson
Copy link
Owner

@ducvu212 I just pushed version 3.0.0 which resolved the compile issues on my end.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants