alan-ai / alan-sdk-flutter

Conversational AI SDK for Flutter to enable text and voice conversations with actions (iOS and Android)
https://alan.app
1.81k stars 39 forks source link

Android Alan Button Issue #3

Closed imcoffeefreak closed 3 years ago

imcoffeefreak commented 3 years ago

Alan Button disappears in release mode flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi

Error displayed: Failed to add Alan button PlatformException(error, Subscriber class com.alan.alansdk.button.a and its super classes have no public methods with the @Subscribe annotation, null, m.a.a.e: Subscriber class com.alan.alansdk.button .a and its super classes have no public methods with the @Subscribe annotation

snyuryev commented 3 years ago

@imcoffeefreak What is device model and Android version on this device?

btw the preferable way to build release for flutter is using command: flutter build appbundle (The Google Play Store prefers the app bundle format)

if you want to build apk please try to use command: flutter build apk --split-per-abi (without --target-platform option)

imcoffeefreak commented 3 years ago

@imcoffeefreak What is device model and Android version on this device?

btw the preferable way to build release for flutter is using command: flutter build appbundle (The Google Play Store prefers the app bundle format)

if you want to build apk please try to use command: flutter build apk --split-per-abi (without --target-platform option)

Model: RealMe 5 Pro

flutter build apk --split-per-abi does not work either

snyuryev commented 3 years ago

got it. How do you add Alan Button in the flutter app? AlanVoice.addButton("8e0b083e795c924d64635bba9c3571f42e956eca572e1d8b807a3e2338fdd0dc/stage"); something like that?

imcoffeefreak commented 3 years ago

got it. How do you add Alan Button in the flutter app? AlanVoice.addButton("8e0b083e795c924d64635bba9c3571f42e956eca572e1d8b807a3e2338fdd0dc/stage"); something like that?

Yes

rohitghosal commented 3 years ago

need help

Alan Button disappears in release mode of Flutter build apk And got stuck also in debug mode in android 10 nokia 6.1plus

snyuryev commented 3 years ago

@rohitghosal @imcoffeefreak

Please try to add additional params for release build type

shrinkResources false
minifyEnabled false

to your build.gradle file. It should be located

[your_app_folder]/android/app/build.gradle

As result you should have something similar to:

buildTypes {
        release {
            signingConfig signingConfigs.debug
            shrinkResources false
            minifyEnabled false
        }
  }

After that please try to run

flutter build apk

and run your app.

imcoffeefreak commented 3 years ago

@snyuryev

Works good !!!!

@rohitghosal @imcoffeefreak

Please try to add additional params for release build type

shrinkResources false
minifyEnabled false

to your build.gradle file. It should be located

[your_app_folder]/android/app/build.gradle

As result you should have something similar to:

buildTypes {
        release {
            signingConfig signingConfigs.debug
            shrinkResources false
            minifyEnabled false
        }
  }

After that please try to run

flutter build apk

and run your app.

snyuryev commented 3 years ago

@imcoffeefreak I'm glad to help you!