我已经构建了一个用 Flutter 编写的应用程序,它在我的设备上运行良好。
然而,在客户端设备上它在启动时崩溃(甚至在 Centry 启动之前)。
当连接到 ADB 时,我们得到了这个日志:
AndroidRuntime: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.travel.exchange-1/base.apk"],nativeLibraryDirectories=[/data/app/com.travel.exchange-1/lib/arm, /data/app/com.travel.exchange-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]] couldn't find "libflutter.so"
at java.lang.Runtime.loadLibrary (Runtime.java:367)
at java.lang.System.loadLibrary (System.java:1076)
at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:172)
at io.flutter.view.FlutterMain.startInitialization (FlutterMain.java:149)
at io.flutter.app.FlutterApplication.onCreate (FlutterApplication.java:22)
at android.app.Instrumentation.callApplicationOnCreate (Instrumentation.java:1037)
at android.app.ActivityThread.handleBindApplication (ActivityThread.java:6496)
at android.app.ActivityThread.access$1800 (ActivityThread.java:229)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:1887)
at android.os.Handler.dispatchMessage (Handler.java:102)
at android.os.Looper.loop (Looper.java:148)
at android.app.ActivityThread.main (ActivityThread.java:7406)
at java.lang.reflect.Method.invoke (Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1120)
Run Code Online (Sandbox Code Playgroud)
我正在专门使用 arm64 进行构建(如果我尝试在 arm (32) 上运行,应用程序即使在我的设备上也会崩溃)。
flutter build apk --release --target-platform=android-arm64
Run Code Online (Sandbox Code Playgroud) 我在 Flutter 上为 iOS 设置推送通知时遇到问题。另一个开发人员也尝试添加 - 遇到了同样的问题。
TL;DR:任何人都可以通过稳定渠道的全新构建在 iOS Flutter 上运行推送吗?
我遵循此处描述的设置步骤:https : //pub.dev/packages/firebase_messaging
具体来说:
在 AppDelegate.swift 中添加了几行
if #available(iOS 10.0, *) { UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate }
推不来。当应用程序在后台时,根本不是。
我还尝试了另一个步骤 - 发送个人推送。在 CURL 中发送代码如下所示:
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:key=AIza_legacy_key" \
-d \
'{
"to": "my_push_token",
"notification": …Run Code Online (Sandbox Code Playgroud) 我在 Flutter Web 应用程序中使用 Firebase 服务并且在加载 firebase 脚本时遇到问题。
当我使用 flutter run -d chrome 时,我看到空白页面有错误,并且在重新加载页面后正常加载:-/。
当我执行 flutter build web 时 - 页面从未加载,重新加载无济于事。
潜在错误: 未捕获的 ReferenceError:firebase 未定义
这是我在第一次启动时看到的内容flutter run -d chrome:
Uncaught ReferenceError: firebase is not defined
at (index):26
app.js:1 Failed to load resource: the server responded with a status of 404 (Not Found)
require.js:143 Uncaught Error: Script error for "@firebase/app", needed by: dart_sdk
http://requirejs.org/docs/errors.html#scripterror
at makeError (require.js:168)
at HTMLScriptElement.onScriptError (require.js:1738)
:57663/favicon.ico:1 Failed to load resource: the server responded …Run Code Online (Sandbox Code Playgroud)