flutter_cognito_plugin icon indicating copy to clipboard operation
flutter_cognito_plugin copied to clipboard

MissingPluginException when creating a .APK.

Open ilikepi63 opened this issue 5 years ago • 13 comments
trafficstars

The plugin works fine if using the android emulator, however once generating an apk using "flutter build apk", an exception is thrown where it cannot find the corresponding plugin. I have tested other plugins and it seems that this is the only one that is not working in this manner.

ilikepi63 avatar Dec 19 '19 13:12 ilikepi63

Same issue here.

yuensunn avatar Dec 27 '19 03:12 yuensunn

Same issue here...

Detailed logs:

FAILURE: Build failed with an exception.

* Where:
Build file 'xx/xx/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_cognito_plugin-1.0.2/android/build.gradle' line: 45

* What went wrong:
A problem occurred evaluating root project 'flutter_cognito_plugin'.
> Project with path ':plugin_scaffold' could not be found in root project 'flutter_cognito_plugin'.

* 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 1m 54s

samuelchanx avatar Jan 02 '20 05:01 samuelchanx

Update. Running flutter clean solved it for me. Update again. flutter clean did not solve the problem but flutter run --release did

yuensunn avatar Jan 02 '20 09:01 yuensunn

Resolved. In addition to adding the AWS rules for proguard, I excluded this plugin package to make it working even when proguard or R8 turned on.

-keepnames class com.amazonaws.** { *; }
-keepnames class com.amazon.** { *; }
# Flutter Cognito Pluggin
-keep class com.pycampers.** { *; }

Then the plugin would work even with obfuscation on Android.

samuelchanx avatar Jan 07 '20 08:01 samuelchanx

@samuelchanx you're a lifesaver thanks a lot!

yuensunn avatar Jan 08 '20 08:01 yuensunn

@samuelchanx thank you, mate! you save my life. I struggle with this issue all day, and I'm not too familiar with native Android development.

bepitulaz avatar Jan 23 '20 11:01 bepitulaz

In my case, the following worked for me:

...
-keep class com.amazonaws.** { *; }
-keep class com.amazon.** { *; }
-keep class com.pycampers.** { *; }

JeSuisAlrick avatar Mar 18 '20 01:03 JeSuisAlrick

Resolved. In addition to adding the AWS rules for proguard, I excluded this plugin package to make it working even when proguard or R8 turned on.

-keepnames class com.amazonaws.** { *; }
-keepnames class com.amazon.** { *; }
# Flutter Cognito Pluggin
-keep class com.pycampers.** { *; }

Then the plugin would work even with obfuscation on Android.

This one was okay before flutter_cognito_plugin version 2.0.0. After upgrading to version 2.0.0 this one is not working anymore. I spent 2 days making it works again, and I don't know why this combination below is working in version 2.0.0.

-keep class com.amazonaws.** { *; }
-keep class com.amazon.** { *; }
-keep class com.pycampers.** { *; }

bepitulaz avatar Apr 24 '20 08:04 bepitulaz

If you don't care about minifying, try adding the following to android/app/build.gradle.

android {
    ...

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

devxpy avatar Apr 29 '20 07:04 devxpy

Resolved. In addition to adding the AWS rules for proguard, I excluded this plugin package to make it working even when proguard or R8 turned on.

-keepnames class com.amazonaws.** { *; }
-keepnames class com.amazon.** { *; }
# Flutter Cognito Pluggin
-keep class com.pycampers.** { *; }

Then the plugin would work even with obfuscation on Android.

Hi, i am sorry, where can i put this codes ?

kukuandroid avatar May 06 '20 15:05 kukuandroid

@kukuandroid in ur proguard-rules.pro inside android directory

samuelchanx avatar May 12 '20 12:05 samuelchanx

I think it should be in the readme

fryette avatar Jun 16 '20 21:06 fryette

Hey all I am facing this issue can someone provide the solution MissingPluginException(No implementation found for method attachPolicy on channel com.scientifichackers.aws_iot)

itskgore avatar Aug 26 '20 11:08 itskgore