Comments (17)
32 位的 arch cpu 和 64 位 arch cpu 分开编译。
flutter build apk #32位
flutter build apk --target-platform android-arm64 #64位
from jpush-flutter-plugin.
看你的 apk 里面没有 lib/armeabi-v7a/libflutter.so 这个文件。
from jpush-flutter-plugin.
注: /Applications/flutter/.pub-cache/hosted/pub.flutter-io.cn/jpush_flutter-0.0.9/android/src/main/java/com/jiguang/jpush/JPushPlugin.java使用了未经检查或不安全的操作。
注: 有关详细信息, 请使用 -Xlint:unchecked 重新编译。
这个在第一次打包编辑时会出现这个问题
from jpush-flutter-plugin.
这个编译警告和你的奔溃没有关系,奔溃原因就是打包的时候没有生成 lib/armeabi-v7a/libflutter.so 文件。
from jpush-flutter-plugin.
flutter build apk --target-platform android-arm64 #64位 无效 和以前是一样的 32位的打包后可以在8.1的华为手机上跑了
from jpush-flutter-plugin.
@ihqrbb 请问你的gradle是否配置了 ndk abiFilters
有的话,麻烦发一下abiFilters的配置信息。
from jpush-flutter-plugin.
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}
def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}
apply plugin: 'com.android.application'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion 27
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.shop.cchsxk"
minSdkVersion 16
targetSdkVersion 27
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'mips', 'mips64' // 'arm64-v8a',
}
manifestPlaceholders = [
JPUSH_PKGNAME : applicationId,
JPUSH_APPKEY : "****ed0ea6b835ae1cdd669", // NOTE: JPush 上注册的包名对应的 Appkey.
JPUSH_CHANNEL : "developer-default", //暂时填写默认值即可.
]
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
}
}
}
flutter {
source '../..'
}
dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
from jpush-flutter-plugin.
@shikk 发了
from jpush-flutter-plugin.
@shikk 发了
'arm64-v8a' 为什么要注释掉呢?
flutter插件,arm64位架构只支持arm64-v8a呢。
如果注释掉,你打包的又是64位的apk,在arm64的手机上那肯定是找不到libflutter.so而没法运行了。
from jpush-flutter-plugin.
@shikk @huangminlinux
你们好呀,我也遇到了一样的情况 小米6手机。调试的时候无任何问题,打包后出现错误无法打开应用。按照 @huangminlinux 提供的办法,打包后无任何问题。
flutter build apk --target-platform android-arm64 #64位
但是,如果我要上架到商店或者提供网页下载链接的时候,使用上述打包的方式生成APK文件, 在#32位的手机上也能运行吗?
from jpush-flutter-plugin.
对啊,我也好奇,编译两个apk,那怎么发布呢?
from jpush-flutter-plugin.
我找到一种办法,我这边测试可以了,就是只生成armeabi-v7a这一个类型的so库
ndk { //选择要添加的对应 cpu 类型的 .so 库。 abiFilters 'armeabi-v7a'//'armeabi', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' }
from jpush-flutter-plugin.
非常感谢 @huangminlinux ,果然加了target-platform参数就可以啦
from jpush-flutter-plugin.
我找到一种办法,我这边测试可以了,就是只生成armeabi-v7a这一个类型的so库
ndk { //选择要添加的对应 cpu 类型的 .so 库。 abiFilters 'armeabi-v7a'//'armeabi', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' }
你注释之后,还是无法在其他平台运行呀 @itlws
from jpush-flutter-plugin.
我找到一种办法,我这边测试可以了,就是只生成armeabi-v7a这一个类型的so库
ndk { //选择要添加的对应 cpu 类型的 .so 库。 abiFilters 'armeabi-v7a'//'armeabi', 'x86', 'x86_64', 'mips', 'mips64', 'arm64-v8a' }
你注释之后,还是无法在其他平台运行呀 @itlws
你用的是什么手机?我这边测试时可以的,我用的是小米3和小米8测试的可以,小米3cpu是32位的,小米8cpu是64位,运行都可以
from jpush-flutter-plugin.
添加ndk后调试模式连不上真机了
from jpush-flutter-plugin.
flutter开发的release版本在小米9上没有任何问题,在mi8lite版本里,启动图片加载完直接崩溃,日志显示:Canvas: trying to draw too large(111561120bytes) bitmap。
from jpush-flutter-plugin.
Related Issues (20)
- [iOS][AppStore]`Adaptor iOS privacy manifest` HOT 6
- 2024 Flutter iOS 隐私清单适配。否则五一app全部下架。 HOT 2
- 这玩意没法用啊
- dev3.x分支的example无法运行
- didReceiveRemoteNotification默认返回了YES
- 鸿蒙SDK已经发布了,接口也差不多,flutter啥时候加入?
- 请公开参数设置[JPUSHService setLocationEanable:];
- doesn't show notification when app is closed or terminated
- xcode编译flutter项目时报错,提示xcode compiler error "#import <duq.h>" HOT 1
- 角标数字怎样清除啊?
- 小米审核需要提供位置权限的证明材料
- PlatformException(6002, , , null)#2 JPush.setAlias (package:jpush_flutter/jpush_flutter.dart:278:9)
- MissingPluginException(No implementation found for method getRegistrationID on channel jpush)#1 JPush.getRegistrationID (package:jpush_flutter/jpush_flutter.dart:381)
- 设置别名异常,PlatformException(Error 6027, JPush.Flutter, The operation couldn’t be completed. (JPush.Flutter error 6027.), null) HOT 2
- 分支 dev-3.x 最新提交(更新JPush 540) 导致应用闪退 HOT 5
- flutter 项目小米审核被拒
- 华为推送厂商接入问题 HOT 1
- 应用内消息跳转问题 HOT 1
- sendLocalNotification 创建的本地推送 iOS无法收到
- 集成oppo厂商推送,收不到离线推送
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jpush-flutter-plugin.