flutter_cognito_plugin
flutter_cognito_plugin copied to clipboard
MissingPluginException when creating a .APK.
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.
Same issue here.
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
Update. Running flutter clean
solved it for me.
Update again. flutter clean
did not solve the problem but flutter run --release
did
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 you're a lifesaver thanks a lot!
@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.
In my case, the following worked for me:
...
-keep class com.amazonaws.** { *; }
-keep class com.amazon.** { *; }
-keep class com.pycampers.** { *; }
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.** { *; }
If you don't care about minifying, try adding the following to android/app/build.gradle
.
android {
...
buildTypes {
release {
...
shrinkResources false
minifyEnabled false
}
}
}
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 in ur proguard-rules.pro
inside android directory
I think it should be in the readme
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)