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

App Crash in Release Mode #48

Closed
HardikkMadaan opened this issue Dec 10, 2019 · 29 comments
Closed

App Crash in Release Mode #48

HardikkMadaan opened this issue Dec 10, 2019 · 29 comments

Comments

@HardikkMadaan
Copy link

The app crashes as soon as i try to enter a channel name and click on join in release mode .
I have added the keep class statement to my proguard file and also removed 'arm-v8a- from the ndk in build.gradle.

This is my log. Please help!
'''
E/flutter ( 5813): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.NoSuchMethodError: no static or non-static method "Lio/agora/rtc/internal/RtcEngineImpl;.nativeGetParameters(JLjava/lang/String;)Ljava/lang/String;"
E/flutter ( 5813): at java.lang.Runtime.nativeLoad(Native Method)
E/flutter ( 5813): at java.lang.Runtime.doLoad(Runtime.java:435)
E/flutter ( 5813): at java.lang.Runtime.loadLibrary(Runtime.java:370)
E/flutter ( 5813): at java.lang.System.loadLibrary(System.java:1076)
E/flutter ( 5813): at io.agora.rtc.internal.RtcEngineImpl.E(Unknown Source)
E/flutter ( 5813): at io.agora.rtc.internal.RtcEngineImpl.F(Unknown Source)
E/flutter ( 5813): at io.agora.rtc.c.a(Unknown Source)
E/flutter ( 5813): at io.agora.a.c.onMethodCall(Unknown Source)
E/flutter ( 5813): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(Unknown Source)
E/flutter ( 5813): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(Unknown Source)
E/flutter ( 5813): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(Unknown Source)
E/flutter ( 5813): at android.os.MessageQueue.nativePollOnce(Native Method)
E/flutter ( 5813): at android.os.MessageQueue.next(MessageQueue.java:323)
E/flutter ( 5813): at android.os.Looper.loop(Looper.java:135)
E/flutter ( 5813): at android.app.ActivityThread.main(ActivityThread.java:5539)
E/flutter ( 5813): at java.lang.reflect.Method.invoke(Native Method)
E/flutter ( 5813): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
E/flutter ( 5813): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/flutter ( 5813):
F/flutter ( 5813): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).

'''

@plutoless
Copy link
Contributor

AgoraIO-Extensions/Agora-Flutter-SDK#32
please double check if this is relevant

@HardikkMadaan
Copy link
Author

AgoraIO/Flutter-SDK#32
please double check if this is relevant

I followed this now the app is not crashing on release mode . But when i try to update it on play store, i receive the following error
This release is not compliant with the Google Play 64-bit requirement

The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code: 9.

Include 64-bit and 32-bit native code in your app. Use the Android App Bundle publishing format to automatically ensure that each device architecture receives only the native code it needs. This avoids increasing the overall size of your app

And when i remove Agora from my project .This error also goes and i am able to publish the app on the Play Store

@plutoless
Copy link
Contributor

i will double check this issue tomorrow

@HardikkMadaan
Copy link
Author

i will double check this issue tomorrow

Did you check it sir?

@plutoless
Copy link
Contributor

could you pls try following this thread to see if it fix your issue?

@HardikkMadaan
Copy link
Author

could you pls try following this thread to see if it fix your issue?

I Tried them all, listed in this thread, the problem still persists!

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Dec 27, 2019

hey, check android.enableR8=true in your gradle.properties
set this to your android/app/build.gradle, and try again

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

@HardikkMadaan
Copy link
Author

hey, check android.enableR8=true in your gradle.properties
set this to your android/app/build.gradle, and try again

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

I have done both of these, also there are many solutions in that thread. Can you please tell me one universal solution because I've tried different versions of those and they are not working. Thank you

@LichKing-2234
Copy link
Contributor

it just a minify problem, android.enableR8=true will enable minify, you have tried to add my configuration?

@LichKing-2234
Copy link
Contributor

you can give me your demo, I will try to help you

@HardikkMadaan
Copy link
Author

you can give me your demo, I will try to help you

Sir my demo is a really normal application that was working fine on the play store also but not working when using this package. Please help

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Jan 3, 2020

can you modify our demo to repeat the bug?

@HardikkMadaan
Copy link
Author

can you modify our demo to repeat the bug?

To repeat the bug, just upload your demo on the play store. The app downloads properly but does not get open

@LichKing-2234
Copy link
Contributor

before upload, the apk will crash by install with adb?

@ahmadf20
Copy link

ahmadf20 commented Feb 7, 2020

I'm having the same issue. Is there any solution yet?

@matgeroe
Copy link

matgeroe commented Feb 7, 2020

disabling minifyEnabled and shrinkResources worked for me

@LichKing-2234
Copy link
Contributor

please refer to the readme.md

@HardikkMadaan
Copy link
Author

The issue has been resolved for me. Thanks !

@AnupKumarPanwar
Copy link

@HardikkMadaan How did you solve this issue?
The following APKs or App Bundles are available to 64-bit devices, but they only have 32-bit native code.

@alidemircans
Copy link

I integrated it into my project. I tested it in debug mode it worked. But when you publish it on google play, the application closes.

@LichKing-2234
Copy link
Contributor

@alidemircans what version have you used?

@jaafarnejm
Copy link

I faced the same problem with Flutter + Agora, I followed these steps which solved my problem:

  1. Add to android/app/build.gradle file inside buildTypes bloc:
buildTypes {
        release {
            signingConfig signingConfigs.release

            minifyEnabled true // Add this
            useProguard true // Add this
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  // Add this
        }
  1. Create a new file under android/app/ and name it "proguard-rules.pro"
  2. Insert these lines to :
#Flutter Wrapper
-keep class io.flutter.app.** { *; }
-keep class io.flutter.plugin.**  { *; }
-keep class io.flutter.util.**  { *; }
-keep class io.flutter.view.**  { *; }
-keep class io.flutter.**  { *; }
-keep class io.flutter.plugins.**  { *; }
-keep class io.agora.**  {*;}

Finally, make sure that your Agora project stage supports live.

@delwar36
Copy link

The issue has been resolved for me. Thanks !

I tried the solution given on the readme.md. But still crashing the app. How did you solve that?

@luantrasel
Copy link

luantrasel commented Apr 22, 2021

I also followed solution on readme.md and app is still crashing for me as well

@LichKing-2234
Copy link
Contributor

pls provide the error log

@delwar36
Copy link

pls provide the error log

When I run command flutter run --release it works fine. But when I build apk file and try to install and open it, the app crashes. How can I get the log in this case?

@LichKing-2234
Copy link
Contributor

LichKing-2234 commented Apr 28, 2021

Android: from adb logcat
iOS: get the .crash file

@DallingtonAsin
Copy link

hey, check android.enableR8=true in your gradle.properties
set this to your android/app/build.gradle, and try again

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

I have done both of these, also there are many solutions in that thread. Can you please tell me one universal solution because I've tried different versions of those and they are not working. Thank you

Yes, this was very helpful. I was using agora in react-native and this solution fixed the above "App Crash in Release Mode" bug. Thank you @HardikkMadaan

@darul9061
Copy link

This issue still persist

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