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

Android specific options (useWideViewPort, loadWithOverviewMode, supportZoom, builtInZoomContros, displayZoomControls) not working on apk release #280

Closed
furiousdazzewizard opened this issue Feb 11, 2020 · 4 comments
Labels

Comments

@furiousdazzewizard
Copy link

Environment

**Flutter version: v1.12.13+hotfix.7, on Microsoft Windows [Version 10.0.17763.973]
**Plugin version: Flutter plugin version 43.0.1 on Android Studio 3.5
**Android version: Android 9 (API 28)
**iOS version: N/A
**Xcode version: N/A
**Device information: SM J400M • 42006eb568b2a543 • android-arm • Android 9 (API 28)

Description

The above mentioned android specific options work fine on the debug version of the app. On the release version, however, neither of those options work (seems to be unavailable).

Expected behavior: For example, the web page should be displayed in overview mode, with a desktop-like view.
image

Current behavior: the web page is displayed in its original size, bigger than the screen size of the webview.. In addition, zoom support is not available so it is not possible to fit size.

image

Steps to reproduce

  1. Make a project with a web view to shop an given url with the above mentioned android options activated:
    .
    .
    .
    @OverRide
    Widget build(BuildContext context) {
    data = ModalRoute.of(context).settings.arguments;
    return Scaffold(
    appBar: AppBar(
    title: Text(
    'any text...',
    style: GoogleFonts.indieFlower(),
    ),
    elevation: 15.0,
    ),
    body: InAppWebView(
    initialUrl: data['url'],
    initialHeaders: {},
    initialOptions: InAppWebViewWidgetOptions(
    crossPlatform: InAppWebViewOptions(
    preferredContentMode: InAppWebViewUserPreferredContentMode.DESKTOP,
    ),
    android: AndroidInAppWebViewOptions(
    useWideViewPort: true,
    loadWithOverviewMode: true,
    supportZoom: true,
    builtInZoomControls: true,
    displayZoomControls: true,
    ),
    ),
    onWebViewCreated: (InAppWebViewController controller) {
    webView = controller;
    },
    ),
    );
    }
  2. Generate the debug apk and/or run the app from IDE and you will get the EXPECTED behaviour
  3. Generate the release apk, install & run it in the smartphone and you will get the CURRENT behaviour
@chrisnyw
Copy link

after a couple of time to cater with this issue, I just get a workaround to solve this,

when building a release build of apk, pass also the --no-shrink to flutter build
flutter build apk --no-shrink

I got the following debug lot when enabled the debug log option in WebView, and it is only happened in release build but not debug build.

02-24 16:34:50.051 13671 13671 D Options : No field useShouldOverrideUrlLoading in class Lcom/pichillilorenzo/flutter_inappwebview/InAppWebView/G; (declaration of 'com.pichillilorenzo.flutter_inappwebview.InAppWebView.G' appears in base.apk)
02-24 16:34:50.051 13671 13671 D Options : No field initialScale in class Lcom/pichillilorenzo/flutter_inappwebview/InAppWebView/G; (declaration of 'com.pichillilorenzo.flutter_inappwebview.InAppWebView.G' appears in base.apk)

hope it may help you

@aboutmydreams
Copy link

I just use AndroidInAppWebViewOptions :
databaseEnabled: true,
domStorageEnabled: true,

Successfully run in debug mode,but fail in
flutter build apk --target-platform android-arm,android-arm64 --split-per-abi

This was referenced Jul 6, 2020
Copy link

github-actions bot commented Oct 7, 2024

This issue is stale and has been automatically closed because it has been open for more than 365 days with no activity. Please reopen a new issue if you still have it.

@github-actions github-actions bot added the stale label Oct 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 7, 2024
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants