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

Doesnt worked when appbundle is built #13

Closed
shanazainab opened this issue May 8, 2020 · 6 comments
Closed

Doesnt worked when appbundle is built #13

shanazainab opened this issue May 8, 2020 · 6 comments

Comments

@shanazainab
Copy link

Hereby including platform exception. To do with proguards

[ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Unrecognized suffix for the AWS http client class name b, null)
E/flutter (29996): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:569)
E/flutter (29996): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:321)
E/flutter (29996):
E/flutter (29996): #2 AmazonS3Cognito.upload (package:amazon_s3_cognito/amazon_s3_cognito.dart:36)
E/flutter (29996): #3 CustomerProfileController.uploadProfileImage (package:cabcustomer/controller/customer-profile-controller.dart:177)
E/flutter (29996):
E/flutter (29996): #4 _EditProfileState.handleEditProfile (package:cabcustomer/view/main-drawer/edit-profile.dart:351)
E/flutter (29996): #5 _EditProfileState.build.. (package:cabcustomer/view/main-drawer/edit-profile.dart:233)
E/flutter (29996): #6 _InkResponseState._handleTap (package:flutter/src/material/ink_well.dart:706)
E/flutter (29996): #7 _InkResponseState.build. (package:flutter/src/material/ink_well.dart:789)
E/flutter (29996): #8 GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:182)
E/flutter (29996): #9 TapGestureRecognizer.handleTapUp (package:flutter/src/gestures/tap.dart:486)
E/flutter (29996): #10 BaseTapGestureRecognizer._checkUp (package:flutter/src/gestures/tap.dart:281)
E/flutter (29996): #11 BaseTapGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap.dart:236)
E/flutter (29996): #12 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:156)
E/flutter (29996): #13 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:222)
E/flutter (29996): #14 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:198)
E/flutter (29996): #15 GestureBinding._handlePointerEvent (package:flutter/src/gestures/binding.dart:156)
E/flutter (29996): #16 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:102)
E/flutter (29996): #17 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:86)
E/flutter (29996): #18 _rootRunUnary (dart:async/zone.dart:1138)
E/flutter (29996): #19 _CustomZone.runUnary (dart:async/zone.dart:1031)
E/flutter (29996): #20 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933)
E/flutter (29996): #21 _invoke1 (dart:ui/hooks.dart:273)
E/flutter (29996): #22 _dispatchPointerDataPacket (dart:ui/hooks.dart:182)
E/flutter (29996):

@ghost
Copy link

ghost commented Jun 16, 2020

I too have the same error, did you find a solution?

E/flutter: [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: PlatformException(error, Unrecognized suffix for the AWS http client class name b, null)

@ghost
Copy link

ghost commented Jun 16, 2020

Ah, nevermind.

Looks like the solution is here: #7

@ghost
Copy link

ghost commented Jun 16, 2020

You need to follow the instructions here:

https://stackoverflow.com/questions/35480567/am-getting-error-after-i-created-amazon-coginto-in-android

In short I created a file under '/android/app/proguard-rules.pro' and used all lines starting "-keep" from https://github.com/krschultz/android-proguard-snippets/blob/master/libraries/proguard-aws-2.1.5.pro, then in your 'android/app/build.gradle' you can add:

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

            // Enables code shrinking, obfuscation, and optimization for only
            // your project's release build type.
            minifyEnabled true

            // Enables resource shrinking, which is performed by the
            // Android Gradle plugin.
            shrinkResources true

            // Includes the default ProGuard rules files that are packaged with
            // the Android Gradle plugin. To learn more, go to the section about
            // R8 configuration files.
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }

@yswtrue
Copy link

yswtrue commented Aug 24, 2020

You need to follow the instructions here:

https://stackoverflow.com/questions/35480567/am-getting-error-after-i-created-amazon-coginto-in-android

In short I created a file under '/android/app/proguard-rules.pro' and used all lines starting "-keep" from https://github.com/krschultz/android-proguard-snippets/blob/master/libraries/proguard-aws-2.1.5.pro, then in your 'android/app/build.gradle' you can add:

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

            // Enables code shrinking, obfuscation, and optimization for only
            // your project's release build type.
            minifyEnabled true

            // Enables resource shrinking, which is performed by the
            // Android Gradle plugin.
            shrinkResources true

            // Includes the default ProGuard rules files that are packaged with
            // the Android Gradle plugin. To learn more, go to the section about
            // R8 configuration files.
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }

it works for me

@imkrishnaagrawal
Copy link

imkrishnaagrawal commented Aug 27, 2020

I ran into the same issue. The upload was working in debug however, facing issues with release build. I followed the below steps to resolve it.
You have to configure proguard.

  1. Add below config at android/app/build.gradle File inside buildTypes section.
buildTypes {
    release {
            // Signing with the debug keys for now, so `flutter run --release` works.
            signingConfig signingConfigs.debug
            multiDexEnabled true
            minifyEnabled true
            useProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'),
            'proguard-rules.pro'
        }
}
  1. Create proguard-rules.pro File at android\app\proguard-rules.pro and add below content.
-keep class com.amazonaws.** { *; }
-keep class com.amazon.** { *; }
-keep class com.pycampers.** { *; }

@chakravarthi-v
Copy link

@imkrishnaagrawal Thankyou :) this worked for me

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

5 participants