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

Does not work on Android 10 device release build #441

Closed
wijesijp opened this issue Aug 13, 2020 · 20 comments
Closed

Does not work on Android 10 device release build #441

wijesijp opened this issue Aug 13, 2020 · 20 comments
Labels
status: needs more info We need more information before we can continue work on this issue.

Comments

@wijesijp
Copy link

wijesijp commented Aug 13, 2020

My test device have android 10
I have cached_network_image: ^2.2.0+1

in build.gradle I have;

minSdkVersion 21
targetSdkVersion 29

When I run it in debug mode on the device everything works fine.

But when I run it in release mode does not show any images, but I can see the data is getting downloaded.

flutter run --release -v

[ +129 ms] executing: [C:\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +86 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ ] 2ae34518b87dd891355ed6c6ea8cb68c4d52bb9d
[ ] executing: [C:\flutter/] git tag --contains HEAD
[ +357 ms] Exit code 0 from: git tag --contains HEAD
[ ] 1.20.1
[ +7 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[ +67 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/stable
[ ] executing: [C:\flutter/] git ls-remote --get-url origin
[ +52 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ +90 ms] executing: [C:\flutter/] git rev-parse --abbrev-ref HEAD
[ +56 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ +70 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +25 ms] executing: C:\Android\Sdk\platform-tools\adb.exe devices -l
[ +59 ms] List of devices attached
emulator-5554 device product:sdk_gphone_x86_arm model:AOSP_on_IA_Emulator device:generic_x86_arm
transport_id:1
[ +14 ms] C:\Android\Sdk\platform-tools\adb.exe -s emulator-5554 shell getprop
[ +97 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ +10 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ +1 ms] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +164 ms] Found plugin cloud_firestore at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.13.7
[ +14 ms] Found plugin cloud_firestore_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore_web-0.1.1+2
[ +23 ms] Found plugin firebase_auth at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth-0.16.1
[ +7 ms] Found plugin firebase_auth_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth_web-0.1.3+1
[ +5 ms] Found plugin firebase_core at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core-0.4.5
[ +7 ms] Found plugin firebase_core_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core_web-0.1.1+2
[ +4 ms] Found plugin firebase_storage at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_storage-3.1.6
[ +9 ms] Found plugin flutter_facebook_login at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_facebook_login-3.0.0
[ +7 ms] Found plugin flutter_plugin_android_lifecycle at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.8
[ +11 ms] Found plugin image_picker at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\image_picker-0.6.7+4
[ +21 ms] Found plugin path_provider at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.6.11
[ +5 ms] Found plugin path_provider_linux at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider_linux-0.0.1+2
[ +3 ms] Found plugin path_provider_macos at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider_macos-0.0.4+3
[ +29 ms] Found plugin sqflite at C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\sqflite-1.3.1
[ +20 ms] Found plugin url_launcher at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher-5.5.0
[ +3 ms] Found plugin url_launcher_linux at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_linux-0.0.1+1
[ +2 ms] Found plugin url_launcher_macos at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_macos-0.0.1+7
[ +5 ms] Found plugin url_launcher_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_web-0.1.2
[ +205 ms] Found plugin cloud_firestore at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.13.7
[ +5 ms] Found plugin cloud_firestore_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore_web-0.1.1+2
[ +7 ms] Found plugin firebase_auth at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth-0.16.1
[ +3 ms] Found plugin firebase_auth_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_auth_web-0.1.3+1
[ +2 ms] Found plugin firebase_core at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core-0.4.5
[ +3 ms] Found plugin firebase_core_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core_web-0.1.1+2
[ +2 ms] Found plugin firebase_storage at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_storage-3.1.6
[ +2 ms] Found plugin flutter_facebook_login at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_facebook_login-3.0.0
[ +2 ms] Found plugin flutter_plugin_android_lifecycle at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.8
[ +3 ms] Found plugin image_picker at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\image_picker-0.6.7+4
[ +6 ms] Found plugin path_provider at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.6.11
[ +2 ms] Found plugin path_provider_linux at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider_linux-0.0.1+2
[ +2 ms] Found plugin path_provider_macos at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider_macos-0.0.4+3
[ +8 ms] Found plugin sqflite at C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\sqflite-1.3.1
[ +5 ms] Found plugin url_launcher at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher-5.5.0
[ +1 ms] Found plugin url_launcher_linux at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_linux-0.0.1+1
[ +2 ms] Found plugin url_launcher_macos at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_macos-0.0.1+7
[ +3 ms] Found plugin url_launcher_web at
C:\Users\Janaka\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\url_launcher_web-0.1.2
[ +78 ms] Generating
E:\TechnoGlitter\Janaka\MyApp\Code\Build\JanakaApp\android\app\src\main\java\io\flutter\plugins\GeneratedPluginRegistrant.java
[ +32 ms] ro.hardware = ranchu
[ +38 ms] "flutter run" took 1,013ms.
[ +9 ms] Release mode is not supported by AOSP on IA Emulator.
[ +3 ms]
#0 throwToolExit (package:flutter_tools/src/base/common.dart:14:3)
#1 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:476:9)

#2 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:860:18)
#3 _rootRunUnary (dart:async/zone.dart:1198:47)
#4 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#10 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#11 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#12 _rootRunUnary (dart:async/zone.dart:1198:47)
#13 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#14 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#15 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#16 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#17 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#18 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#19 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#20 AndroidDevice.isLocalEmulator (package:flutter_tools/src/android/android_device.dart)
#21 _rootRunUnary (dart:async/zone.dart:1198:47)
#22 _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#23 _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#24 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#25 Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#26 Future._completeWithValue (dart:async/future_impl.dart:529:5)
#27 Future._asyncCompleteWithValue. (dart:async/future_impl.dart:567:7)
#28 _rootRun (dart:async/zone.dart:1190:13)
#29 _CustomZone.run (dart:async/zone.dart:1093:19)
#30 _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#31 _CustomZone.bindCallbackGuarded. (dart:async/zone.dart:1037:23)
#32 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#33 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#34 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#35 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

[ +255 ms] ensureAnalyticsSent: 252ms
[ +3 ms] Running shutdown hooks
[ +1 ms] Shutdown hooks complete
[ +1 ms] exiting with code 1

@wijesijp wijesijp changed the title Does not work on Android 10 device Does not work on Android 10 device release build Aug 13, 2020
@alinoaimi
Copy link

alinoaimi commented Aug 13, 2020

I'm facing the same issue, working on iOS, but not on Android

@Sophos007
Copy link

yes i'm also have this problem with android 9 and 10 after release on playstore

@yourshinsuke
Copy link

yourshinsuke commented Aug 19, 2020

same issue. but also debug build.
My project is old so, I use EmbeddingV1Activity.

I added

        <meta-data
            android:name="flutterEmbedding"
            android:value="1" />

on
android/app/src/main/AndroidManifest.xml
but, does not work.

And, I can't change value="1" to value="2"
cause, it happned like
/EmbeddingV1Activity.kt: (12, 48): Type mismatch: inferred type is EmbeddingV1Activity but FlutterEngine was expected

@yourshinsuke
Copy link

I referred from
#437

@yourshinsuke
Copy link

yourshinsuke commented Aug 19, 2020

but, flutter_advanced_networkimage worked.

but useDiskCache: true, it can't work.

@yourshinsuke
Copy link

E/flutter ( 7470): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)

@cmorsucci
Copy link

E/flutter ( 7470): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)

Same issue on Android.. iOS works :(

@renefloor
Copy link
Collaborator

Seems more like an issue with path_provider than with cached_network_image

@yourshinsuke
Copy link

path_provider

@renefloor
Copy link
Collaborator

Is this still an issue? I would have expected way more complaints if this is the case.

@renefloor renefloor added the status: needs more info We need more information before we can continue work on this issue. label Oct 30, 2020
@silvinhodev

This comment has been minimized.

@oscarshaitan
Copy link

same issue here

@bartektartanus
Copy link
Contributor

I'm also having this issue on latest flutter beta:

I/flutter (14431): MissingPluginException(No implementation found for method getTemporaryDirectory on channel plugins.flutter.io/path_provider)
I/flutter (14431): #0      MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:156)
I/flutter (14431): <asynchronous suspension>
I/flutter (14431): #1      getTemporaryDirectory (package:path_provider/path_provider.dart:55)
I/flutter (14431): <asynchronous suspension>
I/flutter (14431): #2      IOFileSystem.createDirectory (package:flutter_cache_manager/src/storage/file_system/file_system_io.dart:15)
I/flutter (14431): <asynchronous suspension>

Only on Android release build. Debug works fine, iOS also works fine.

Building apk with:
flutter build apk --no-shrink
does not help.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.26.0-17.7.pre, on macOS 11.2.1 20D74 darwin-x64, locale pl-PL)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.3.2)
[✓] Connected device (2 available)

@bartektartanus
Copy link
Contributor

Looks like I've found a workaround.
Add this to your android/app/build.gradle file:

android {
   ...

    buildTypes {
        release {
            ...
            shrinkResources false
            minifyEnabled false
        }
    }
}

@no-response
Copy link

no-response bot commented Apr 30, 2021

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@no-response no-response bot closed this as completed Apr 30, 2021
@kightsonsanom
Copy link

this is still an issue, disabling obfuscation on android builds is not a valid solution

@leeprobert
Copy link

this is still an issue, disabling obfuscation on android builds is not a valid solution

Agreed. It is not good to have to do this.

@cahyowhy
Copy link

leaving dot here in case there is another workaround to use minify in release ver

@Crucialjun
Copy link

Was a solution ever found? Still having this error

@fbardecio
Copy link

I'm facing this issue on Flutter 3.19.6 with cached_network_image: 3.3.1, images are not loading on release mode only on Android, if I disable the obfuscation it works, but as mentioned before this shouldn't be the valid solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs more info We need more information before we can continue work on this issue.
Projects
None yet
Development

No branches or pull requests