Skip to content

Enable ProGuard for Android in release mode #11099

Closed

Description

@goderbauer

We should enable ProGuard for Android builds in release mode. It removes unnecessary stuff from the APK and slims down the APK size.

More information: https://developer.android.com/studio/build/shrink-code.html

Currently, enabling ProGuard on the Flutter Gallery saves about 24KB. That's not a lot, but that number could grow. For example, with ProGuard enabled, we could start depend on the Android Support Libraries in the engine without bloating our APKs as ProGuard will strip out all unused code. For the accessibility work, I'd like to depend on the Android Support Libraries because they offer much needed convenience around the raw Android APIs and also easily ensure backwards compatibility to older API versions.

/cc @jakobr-google @mravn-google @tvolkert @Hixie

Activity

  1. added
    t: gradle"flutter build" and "flutter run" on Android
    platform-androidAndroid applications specifically
    on Jul 6, 2017
  2. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Oct 3, 2017
  3. mit-mit commented on Jan 8, 2018

    @mit-mit
    Member

    cc @mravn-google do you think this meets the bar for milestone 3?

  4. mravn-google commented on Jan 8, 2018

    @mravn-google
    Contributor

    @goderbauer Seems to make no real difference to flutter_gallery at the moment (15.2MB with or without minification, it seems). Can we postpone this?

  5. goderbauer commented on Jan 8, 2018

    @goderbauer
    MemberAuthor

    Switching this on would enable us in the future to use the Android Support Libraries for a11y stuff without blowing up the binary size. Those libraries can come in handy and on multiple occasions the Android a11y team has recommended to switch to those as many bugs found in the raw framework implementation of a11y functionality are fixed there.

    Having said that, I don't see us switching the a11y stuff over to the support libraries for milestone 3. So, this can probably also move to the next milestone.

  6. goderbauer commented on Jan 8, 2018

    @goderbauer
    MemberAuthor

    I think we currently do not compile it into out binary and instead require our users to link against it if they need it (@tvolkert, who I think told me that a while ago).

  7. tvolkert commented on Jan 8, 2018

    @tvolkert
    Contributor

    I think we currently do not compile it into out binary and instead require
    our users to link against it if they need it

    Correct. We compile against it but don't bundle it, so users need to make sure it's in their classpath if they intend to use the relevant classes.

  8. added this to the milestone on Mar 14, 2018
  9. goderbauer commented on Mar 14, 2018

    @goderbauer
    MemberAuthor

    Another instance where the Compat classes from the support libraries would have been handy: #15539

  10. lifenautjoe commented on Jan 31, 2019

    @lifenautjoe

    So is Proguard intended to work when following the steps in the "Preparing an android release" Flutter website?

    Crashing on build currently when running

    flutter build apk --release
    Initializing gradle...                                       0.9s
    Resolving dependencies...                                    2.5s
    Gradle task 'assembleProductionRelease'...
    ProGuard, version 5.3.3
    Reading input...
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/0.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/1.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/2.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/3.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/4.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/5.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/6.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/7.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/9.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/10.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/11.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/12.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/13.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/14.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/15.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/16.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/17.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/18.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/19.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/20.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/21.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/22.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/23.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/24.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/25.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/26.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/27.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/28.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/29.jar] (filtered)
    Reading program directory [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/desugar/production/release/8] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/processing-tools/runtime-deps/production/release/desugar_try_with_resources.jar] (filtered)
    Reading program jar [/Users/lifenautjoe/Documents/code/openbook/openbook-app/build/app/intermediates/transforms/mergeJavaRes/production/release/0.jar] (filtered)
    Reading library jar [/Users/lifenautjoe/Library/Android/sdk/platforms/android-27/android.jar]
    Reading library jar [/Users/lifenautjoe/Library/Android/sdk/platforms/android-27/optional/org.apache.http.legacy.jar]
    Note: duplicate definition of library class [org.apache.http.params.HttpConnectionParams]
    Note: duplicate definition of library class [org.apache.http.params.CoreConnectionPNames]
    Note: duplicate definition of library class [org.apache.http.params.HttpParams]
    Note: duplicate definition of library class [org.apache.http.conn.scheme.LayeredSocketFactory]
    Note: duplicate definition of library class [org.apache.http.conn.scheme.SocketFactory]
    Note: duplicate definition of library class [org.apache.http.conn.scheme.HostNameResolver]
    Note: duplicate definition of library class [org.apache.http.conn.ConnectTimeoutException]
    Note: duplicate definition of library class [android.net.http.SslCertificate]
    Note: duplicate definition of library class [android.net.http.SslCertificate$DName]
    Note: duplicate definition of library class [android.net.http.SslError]
    Note: duplicate definition of library class [android.net.http.HttpResponseCache]
    Note: there were 11 duplicate class definitions.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)
    Initializing...
    Note: the configuration refers to the unknown class 'social.openbook.MainActivity'
          Maybe you meant the fully qualified name 'com.example.openbook.MainActivity'?
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Address: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Authenticator: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache$2: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache$CacheResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache$CacheResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cache$Entry: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.CacheControl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.CacheControl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.CertificatePinner: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.CertificatePinner: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.CertificatePinner: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Challenge: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Connection: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionPool: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionPool: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ConnectionSpec$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cookie: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cookie: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Cookie: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Dispatcher: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Dispatcher: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Dispatcher: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.FormBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Handshake: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Handshake: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Handshake: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Headers: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Headers: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Headers: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.HttpUrl$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Interceptor$Chain: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MediaType: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.MultipartBody$Part: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.OkHttpClient$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Request: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Request: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Request$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Request$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody$1: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody$2: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.RequestBody$3: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Response$Builder: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ResponseBody: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.ResponseBody$1: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.Route: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.WebSocket: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.internal.cache.CacheStrategy: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.internal.cache.CacheStrategy: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.internal.cache.DiskLruCache: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.internal.cache.DiskLruCache$Snapshot: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.internal.connection.RealConnection: can't find referenced class javax.annotation.Nullable
    Warning: okhttp3.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
    Warning: okio.AsyncTimeout: can't find referenced class javax.annotation.Nullable
    Warning: okio.AsyncTimeout: can't find referenced class javax.annotation.Nullable
    Warning: okio.AsyncTimeout: can't find referenced class javax.annotation.Nullable
    Warning: okio.AsyncTimeout: can't find referenced class javax.annotation.Nullable
    Warning: okio.Buffer: can't find referenced class javax.annotation.Nullable
    Warning: okio.Buffer: can't find referenced class javax.annotation.Nullable
    Warning: okio.BufferedSource: can't find referenced class javax.annotation.Nullable
    Warning: okio.ByteString: can't find referenced class javax.annotation.Nullable
    Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    Warning: okio.HashingSink: can't find referenced class javax.annotation.Nullable
    Warning: okio.HashingSink: can't find referenced class javax.annotation.Nullable
    Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    Warning: okio.Okio: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
    Warning: okio.Okio$4: can't find referenced class javax.annotation.Nullable
    Warning: okio.RealBufferedSource: can't find referenced class javax.annotation.Nullable
    Warning: okio.Segment: can't find referenced class javax.annotation.Nullable
    Warning: okio.SegmentPool: can't find referenced class javax.annotation.Nullable
    Warning: okio.package-info: can't find referenced class javax.annotation.ParametersAreNonnullByDefault
    Note: com.google.android.exoplayer2.util.Util: can't find dynamically referenced class android.os.SystemProperties
    Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class com.android.org.conscrypt.SSLParametersImpl
    Note: okhttp3.internal.platform.AndroidPlatform: can't find dynamically referenced class org.apache.harmony.xnet.provider.jsse.SSLParametersImpl
    Note: okhttp3.internal.platform.AndroidPlatform$CloseGuard: can't find dynamically referenced class dalvik.system.CloseGuard
    Note: okhttp3.internal.platform.Platform: can't find dynamically referenced class sun.security.ssl.SSLContextImpl
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onTimelineChanged(com.google.android.exoplayer2.Timeline,java.lang.Object,int); }', but not the descriptor class 'com.google.android.exoplayer2.Timeline'
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onTimelineChanged(com.google.android.exoplayer2.Timeline,java.lang.Object); }', but not the descriptor class 'com.google.android.exoplayer2.Timeline'
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onTracksChanged(com.google.android.exoplayer2.source.TrackGroupArray,com.google.android.exoplayer2.trackselection.TrackSelectionArray); }', but not the descriptor class 'com.google.android.exoplayer2.source.TrackGroupArray'
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onTracksChanged(com.google.android.exoplayer2.source.TrackGroupArray,com.google.android.exoplayer2.trackselection.TrackSelectionArray); }', but not the descriptor class 'com.google.android.exoplayer2.trackselection.TrackSelectionArray'
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onPlayerError(com.google.android.exoplayer2.ExoPlaybackException); }', but not the descriptor class 'com.google.android.exoplayer2.ExoPlaybackException'
    Note: the configuration keeps the entry point 'com.google.android.exoplayer2.Player$DefaultEventListener { void onPlaybackParametersChanged(com.google.android.exoplayer2.PlaybackParameters); }', but not the descriptor class 'com.google.android.exoplayer2.PlaybackParameters'
    Note: the configuration keeps the entry point 'com.yalantis.ucrop.view.CropImageView { void setCropBoundsChangeListener(com.yalantis.ucrop.callback.CropBoundsChangeListener); }', but not the descriptor class 'com.yalantis.ucrop.callback.CropBoundsChangeListener'
    Note: the configuration keeps the entry point 'com.yalantis.ucrop.view.OverlayView { void setOverlayViewChangeListener(com.yalantis.ucrop.callback.OverlayViewChangeListener); }', but not the descriptor class 'com.yalantis.ucrop.callback.OverlayViewChangeListener'
    Note: the configuration keeps the entry point 'com.yalantis.ucrop.view.TransformImageView { void setTransformImageListener(com.yalantis.ucrop.view.TransformImageView$TransformImageListener); }', but not the descriptor class 'com.yalantis.ucrop.view.TransformImageView$TransformImageListener'
    Note: the configuration keeps the entry point 'com.yalantis.ucrop.view.widget.AspectRatioTextView { void setAspectRatio(com.yalantis.ucrop.model.AspectRatio); }', but not the descriptor class 'com.yalantis.ucrop.model.AspectRatio'
    Note: the configuration keeps the entry point 'com.yalantis.ucrop.view.widget.HorizontalProgressWheelView { void setScrollingListener(com.yalantis.ucrop.view.widget.HorizontalProgressWheelView$ScrollingListener); }', but not the descriptor class 'com.yalantis.ucrop.view.widget.HorizontalProgressWheelView$ScrollingListener'
    Note: the configuration keeps the entry point 'io.flutter.plugins.videoplayer.VideoPlayerPlugin$VideoPlayer { com.google.android.exoplayer2.source.MediaSource buildMediaSource(android.net.Uri,com.google.android.exoplayer2.upstream.DataSource$Factory,android.content.Context); }', but not the descriptor class 'com.google.android.exoplayer2.upstream.DataSource$Factory'
    Note: the configuration keeps the entry point 'io.flutter.plugins.videoplayer.VideoPlayerPlugin$VideoPlayer { void setAudioAttributes(com.google.android.exoplayer2.SimpleExoPlayer); }', but not the descriptor class 'com.google.android.exoplayer2.SimpleExoPlayer'
    Note: the configuration keeps the entry point 'io.flutter.plugins.videoplayer.VideoPlayerPlugin$VideoPlayer$2 { void onPlayerError(com.google.android.exoplayer2.ExoPlaybackException); }', but not the descriptor class 'com.google.android.exoplayer2.ExoPlaybackException'
    Note: there were 1 references to unknown classes.
          You should check your configuration for typos.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#unknownclass)
    Note: there were 14 unkept descriptor classes in kept class members.
          You should consider explicitly keeping the mentioned classes
          (using '-keep').
          (http://proguard.sourceforge.net/manual/troubleshooting.html#descriptorclass)
    Note: there were 5 unresolved dynamic references to classes or interfaces.
          You should check if you need to specify additional program jars.
          (http://proguard.sourceforge.net/manual/troubleshooting.html#dynamicalclass)
    Warning: Exception while processing task java.io.IOException: Please correct the above warnings first.
    Thread(Tasks limiter_2): destruction
    Warning: there were 169 unresolved references to classes or interfaces.
             You may need to add missing library jars or update their versions.
             If your code works fine without the missing classes, you can suppress
             the warnings with '-dontwarn' options.
             (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:transformClassesAndResourcesWithProguardForProductionRelease'.
    > Job failed, see logs for details
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    
    * Get more help at https://help.gradle.org
    
    BUILD FAILED in 4s
    
    Gradle task 'assembleProductionRelease'... Done              5.4s
    Gradle task assembleProductionRelease failed with exit code 1
  11. bbofrk commented on Feb 7, 2019

    @bbofrk

    Facing the same issue

    Here is flutter doctor just in case

    [✓] Flutter (Channel beta, v1.1.8, on Mac OS X 10.14.3 18D42, locale en-NZ)
        • Flutter version 1.1.8 at /Users/Shareclarity/Developer/flutter
        • Framework revision 985ccb6d14 (4 weeks ago), 2019-01-08 13:45:55 -0800
        • Engine revision 7112b72cc2
        • Dart version 2.1.1 (build 2.1.1-dev.0.1 ec86471ccc)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        • Android SDK at /Users/shareclarity/Library/Android/sdk
        • 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-1136-b06)
        • All Android licenses accepted.
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 10.1, Build version 10B61
        • ios-deploy 2.0.0
        • CocoaPods version 1.5.3
    
    [!] Android Studio (version 3.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        ✗ Flutter plugin not installed; this adds Flutter specific functionality.
        ✗ Dart plugin not installed; this adds Dart specific functionality.
        • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    
    [✓] VS Code (version 1.31.0)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 2.22.3
    
    [!] Connected device
        ! No devices available
    
    ! Doctor found issues in 2 categories.
    
  12. cfguimaraes commented on May 12, 2019

    @cfguimaraes

    Hi all.
    After Flutter SDK Upgrade I face this issue @lifenautjoe posted.

    Flutter doctor
    [✓] Flutter (Channel stable, v1.5.4-hotfix.2, on Linux, locale pt_BR.UTF-8)

    [✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    [✓] Android Studio (version 3.2)
    [✓] VS Code (version 1.33.1)
    [✓] Connected device (1 available)

  13. cfguimaraes commented on May 12, 2019

    @cfguimaraes

    As suggested in #25951 setting minifyEnabled false in android/app/build.gradle builds successfully.
    NOTE: The command I used is: flutter build apk

  14. github-actions commented on Aug 16, 2021

    @github-actions

    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, including the output of flutter doctor -v and a minimal reproduction of the issue.

  15. locked as resolved and limited conversation to collaborators on Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-androidAndroid applications specificallyt: gradle"flutter build" and "flutter run" on AndroidtoolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions