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

LocalStorage not working correctly with targetSDKVersion 26+ #455

Open
stoconnor opened this issue Jun 19, 2019 · 4 comments
Open

LocalStorage not working correctly with targetSDKVersion 26+ #455

stoconnor opened this issue Jun 19, 2019 · 4 comments

Comments

@stoconnor
Copy link

I downloaded the example app in this repo, it ran fine. I changed the baseURL to point at an existing angular app. During the login flow it does an oAuth redirect and saves a number of items to the localstorage. This all works fine with the example app, however, when building for the Play Store a minimum targetSdkVersion of 26 is required. Simply adding targetSdkVersion 26 to the build.gradle file for Android will stop the app getting beyond the oAuth flow, the redirect looks ok so I think it might be a localstorage issue?

System info

Issue occurs on: Android
Plugin version: 0.3.5
Flutter doctor output:

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale en-IE)
 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy out of date (1.9.4 is required). To upgrade with Brew:
        brew upgrade ios-deploy
[✓] Android Studio (version 3.1)
[✓] IntelliJ IDEA Community Edition (version 2018.1.2)
[!] VS Code (version 1.33.1)
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (1 available)

! Doctor found issues in 2 categories.

Logs

The following is the error I get when running with targetSdkVersion 26, I don't get it when I don't have the targetSdkVersion and just have minSdkVersion of 16 and compileSdkVersion 28.

"AADSTS50058: A silent sign-in request was sent but no user is signed in. The cookies used to represent the user's session were not sent in the request to Azure AD.
This can happen if the user is using Internet Explorer or Edge, and the web app sending the silent sign-in request is in different IE security zone than the Azure AD endpoint (login.microsoftonline.com).

^ it seems like a storage/redirect issue with the plugin not working correctly with the latest android sdk?

Docker -v output:

[✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Mac OS X 10.14.4 18E226, locale en-IE)
    • Flutter version 1.5.4-hotfix.2 at XXXX
    • Framework revision 7a4c33425d (7 weeks ago), 2019-04-29 11:05:24 -0700
    • Engine revision 52c7a1e849
    • Dart version 2.3.0 (build 2.3.0-dev.0.5 a1668566e5)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at XXXX
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.2.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2.1, Build version 10E1001
    ✗ Verify that all connected devices have been paired with this computer in Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    • ios-deploy 1.9.2
    ✗ ios-deploy out of date (1.9.4 is required). To upgrade with Brew:
        brew upgrade ios-deploy
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 26.0.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.1.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 26.0.2
    • Dart plugin version 181.4668.60

[!] VS Code (version 1.33.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    ✗ Flutter extension not installed; install from
      https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

! Doctor found issues in 2 categories.

@charafau
Copy link
Collaborator

I might be wrong, but my guess would be runtime permissions ? Since they were introduced in android 26, then maybe you need storage permission? But that's just a quick guess.

@stoconnor
Copy link
Author

stoconnor commented Jun 24, 2019

I did try adding the storage permission, manually enabling it through the Android UI (as oppose to pulling in a permissions library + code). It's possible i need more than the Storage permission. I had Internet and Network Activity permissions also.

@charafau
Copy link
Collaborator

So something must be checked. I assume that your website works in other android app? Do you have some example that I can test it on?

@stoconnor
Copy link
Author

The app works in all mobile browsers and apk built with targetSDKVersion < 26, but this obviously can't be released to the Play Store. I'll have to create an example app, leave it with me

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

No branches or pull requests

2 participants