Flutter 颤振-本地通知在释放模式下失败
我添加了flatter\u local\u通知插件来安排通知。在调试版本中无论是模拟器还是真实设备都能正常工作 但是,当我构建应用程序时Flutter 颤振-本地通知在释放模式下失败,flutter,Flutter,我添加了flatter\u local\u通知插件来安排通知。在调试版本中无论是模拟器还是真实设备都能正常工作 但是,当我构建应用程序时 flutter build apk --split-per-abi 然后在设备上安装软件包并运行应用程序,当涉及到标记通知的代码部分时(我想…),应用程序崩溃 我怎样才能知道出了什么问题 我按照插件开发人员的说明更改了清单文件: <manifest xmlns:android="http://schemas.an
flutter build apk --split-per-abi
然后在设备上安装软件包并运行应用程序,当涉及到标记通知的代码部分时(我想…),应用程序崩溃
我怎样才能知道出了什么问题
我按照插件开发人员的说明更改了清单文件:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.explika">
<uses-permission android:name="android.permission.INTERNET" />
<!-- Tudo relacionado com as notificações -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Fim relacionado com notificações -->
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="Explika"
android:icon="@mipmap/ic_launcher">
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
</application>
</manifest>
我找到了导致应用程序崩溃的原因: [错误:flatter/shell/platform/android/platform\u view\u android\u jni.cc(39)]java.lang.AssertionError:java.lang.NoSuchFieldException:Drawable 然而,这只发生在发布版本中。解决方案包括按照插件页面上的说明自定义ProGuard配置文件和build.gradle文件。 我没有执行这些步骤,因为在此之前,发布版本工作没有问题,而且我认为只有在希望在Play Store上发布时才需要ProGuard配置文件