口味😋: 修复高德地图release编译会闪退问题
This commit is contained in:
parent
fd094f916c
commit
9e999a316f
@ -56,11 +56,13 @@ android {
|
|||||||
dev {
|
dev {
|
||||||
dimension "flavor-type"
|
dimension "flavor-type"
|
||||||
applicationId "com.starlock.lock.dev"
|
applicationId "com.starlock.lock.dev"
|
||||||
|
signingConfig signingConfigs.pre
|
||||||
resValue "string", "app_name", "星锁-dev"
|
resValue "string", "app_name", "星锁-dev"
|
||||||
}
|
}
|
||||||
pre {
|
pre {
|
||||||
dimension "flavor-type"
|
dimension "flavor-type"
|
||||||
applicationId "com.starlock.lock.pre"
|
applicationId "com.starlock.lock.pre"
|
||||||
|
signingConfig signingConfigs.pre
|
||||||
resValue "string", "app_name", "星锁"
|
resValue "string", "app_name", "星锁"
|
||||||
}
|
}
|
||||||
sky {
|
sky {
|
||||||
@ -104,18 +106,13 @@ android {
|
|||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
||||||
applicationId "cn.starlock.lock"
|
|
||||||
// You can update the following values to match your application needs.
|
// You can update the following values to match your application needs.
|
||||||
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
|
||||||
// minSdkVersion flutter.minSdkVersion
|
|
||||||
// targetSdkVersion flutter.targetSdkVersion
|
|
||||||
minSdkVersion 25
|
minSdkVersion 25
|
||||||
targetSdkVersion 33
|
targetSdkVersion 33
|
||||||
versionCode flutterVersionCode.toInteger()
|
versionCode flutterVersionCode.toInteger()
|
||||||
versionName flutterVersionName
|
versionName flutterVersionName
|
||||||
|
|
||||||
signingConfig signingConfigs.sky
|
|
||||||
|
|
||||||
// 为减少体积,使用不同架构分包发布编译选项 flutter build apk --split-per-abi
|
// 为减少体积,使用不同架构分包发布编译选项 flutter build apk --split-per-abi
|
||||||
// 所以需要禁用ndk在同一个个包中包含多个架构
|
// 所以需要禁用ndk在同一个个包中包含多个架构
|
||||||
// 但是禁用NDK配置,又无法使用flutter run 命令了,因为编译完成它按照名称匹配找不到.apk包
|
// 但是禁用NDK配置,又无法使用flutter run 命令了,因为编译完成它按照名称匹配找不到.apk包
|
||||||
@ -133,19 +130,21 @@ android {
|
|||||||
universalApk true
|
universalApk true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}// /Users/sky/app-starlock/star_lock/android/app/sky.jks
|
}
|
||||||
buildTypes {
|
buildTypes {
|
||||||
release {
|
release {
|
||||||
|
// 高德地图导致release编译模式下应用闪退,根据:[高德地图在Debug模式下运行正常但是打Release包时则闪退解决办法](https://blog.csdn.net/weixin_39370093/article/details/109631210)
|
||||||
|
// 为release模式设置混淆可以解决地图闪退问题
|
||||||
|
// 真实的解决办法
|
||||||
|
minifyEnabled false
|
||||||
|
shrinkResources false
|
||||||
productFlavors.dev.signingConfig signingConfigs.pre
|
productFlavors.dev.signingConfig signingConfigs.pre
|
||||||
productFlavors.pre.signingConfig signingConfigs.pre
|
productFlavors.pre.signingConfig signingConfigs.pre
|
||||||
productFlavors.sky.signingConfig signingConfigs.sky
|
productFlavors.sky.signingConfig signingConfigs.sky
|
||||||
productFlavors.xhj.signingConfig signingConfigs.xhj
|
productFlavors.xhj.signingConfig signingConfigs.xhj
|
||||||
}
|
}
|
||||||
debug {
|
debug {
|
||||||
productFlavors.dev.signingConfig signingConfigs.pre
|
signingConfig signingConfigs.pre
|
||||||
productFlavors.pre.signingConfig signingConfigs.pre
|
|
||||||
productFlavors.sky.signingConfig signingConfigs.sky
|
|
||||||
productFlavors.xhj.signingConfig signingConfigs.xhj
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.example.star_lock">
|
|
||||||
<!-- The INTERNET permission is required for development. Specifically,
|
|
||||||
the Flutter tool needs it to communicate with the running application
|
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
|
||||||
-->
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
</manifest>
|
|
||||||
@ -58,6 +58,27 @@
|
|||||||
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
|
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
|
||||||
<!-- 请填写你自己的appSecret -->
|
<!-- 请填写你自己的appSecret -->
|
||||||
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
|
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
|
||||||
|
<!-- 华为通道的参数appid -->
|
||||||
|
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx"/>
|
||||||
|
<!-- vivo通道的参数api_key为appkey -->
|
||||||
|
<meta-data android:name="com.vivo.push.api_key" android:value=""/>
|
||||||
|
<meta-data android:name="com.vivo.push.app_id" android:value=""/>
|
||||||
|
<!-- honor通道的参数-->
|
||||||
|
<meta-data android:name="com.hihonor.push.app_id" android:value=""/>
|
||||||
|
<!-- oppo -->
|
||||||
|
<meta-data android:name="com.oppo.push.key" android:value=""/>
|
||||||
|
<meta-data android:name="com.oppo.push.secret" android:value=""/>
|
||||||
|
<!-- 小米-->
|
||||||
|
<meta-data android:name="com.xiaomi.push.id" android:value="id=2222222222222222222"/>
|
||||||
|
<meta-data android:name="com.xiaomi.push.key" android:value="id=5555555555555"/>
|
||||||
|
<!-- 魅族-->
|
||||||
|
<meta-data android:name="com.meizu.push.id" android:value=""/>
|
||||||
|
<meta-data android:name="com.meizu.push.key" android:value=""/>
|
||||||
|
<!-- fcm -->
|
||||||
|
<meta-data android:name="com.gcm.push.sendid" android:value="id=999999999999"/>
|
||||||
|
<meta-data android:name="com.gcm.push.applicationid" android:value=""/>
|
||||||
|
<meta-data android:name="com.gcm.push.projectid" android:value=""/>
|
||||||
|
<meta-data android:name="com.gcm.push.api.key" android:value=""/>
|
||||||
<!-- 消息接收监听器 (用户可自主扩展) -->
|
<!-- 消息接收监听器 (用户可自主扩展) -->
|
||||||
<receiver android:name="cn.starlock.lock.MyMessageReceiver" android:exported="false">
|
<receiver android:name="cn.starlock.lock.MyMessageReceiver" android:exported="false">
|
||||||
<!-- 为保证receiver安全,建议设置不可导出,如需对其他应用开放可通过android:permission进行限制 -->
|
<!-- 为保证receiver安全,建议设置不可导出,如需对其他应用开放可通过android:permission进行限制 -->
|
||||||
|
|||||||
@ -1,62 +0,0 @@
|
|||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.example.star_lock"
|
|
||||||
xmlns:tools="http://schemas.android.com/tools">
|
|
||||||
<!-- The INTERNET permission is required for development. Specifically,
|
|
||||||
the Flutter tool needs it to communicate with the running application
|
|
||||||
to allow setting breakpoints, to provide hot reload, etc.
|
|
||||||
-->
|
|
||||||
<uses-permission android:name="android.permission.READ_CONTACTS"/>
|
|
||||||
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
|
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET"/>
|
|
||||||
|
|
||||||
<application android:label="星锁" android:name="${applicationName}" android:icon="@mipmap/ic_logo">
|
|
||||||
<!-- 请填写你自己的- appKey -->
|
|
||||||
<meta-data android:name="com.alibaba.app.appkey" android:value="333904040"/>
|
|
||||||
<!-- 请填写你自己的appSecret -->
|
|
||||||
<meta-data android:name="com.alibaba.app.appsecret" android:value="c316965fe0a74fc9a481a5c44a535dc2"/>
|
|
||||||
|
|
||||||
<!-- 华为通道的参数appid -->
|
|
||||||
<meta-data android:name="com.huawei.hms.client.appid" android:value="appid=xxxxx" />
|
|
||||||
|
|
||||||
<!-- vivo通道的参数api_key为appkey -->
|
|
||||||
<meta-data android:name="com.vivo.push.api_key" android:value="" />
|
|
||||||
<meta-data android:name="com.vivo.push.app_id" android:value="" />
|
|
||||||
|
|
||||||
<!-- honor通道的参数-->
|
|
||||||
<meta-data android:name="com.hihonor.push.app_id" android:value="" />
|
|
||||||
|
|
||||||
<!-- oppo -->
|
|
||||||
<meta-data android:name="com.oppo.push.key" android:value="" />
|
|
||||||
<meta-data android:name="com.oppo.push.secret" android:value="" />
|
|
||||||
<!-- 小米-->
|
|
||||||
<meta-data android:name="com.xiaomi.push.id" android:value="id=2222222222222222222" />
|
|
||||||
<meta-data android:name="com.xiaomi.push.key" android:value="id=5555555555555" />
|
|
||||||
|
|
||||||
<!-- 魅族-->
|
|
||||||
<meta-data android:name="com.meizu.push.id" android:value="" />
|
|
||||||
<meta-data android:name="com.meizu.push.key" android:value="" />
|
|
||||||
|
|
||||||
<!-- fcm -->
|
|
||||||
<meta-data android:name="com.gcm.push.sendid" android:value="id=999999999999" />
|
|
||||||
<meta-data android:name="com.gcm.push.applicationid" android:value="" />
|
|
||||||
<meta-data android:name="com.gcm.push.projectid" android:value="" />
|
|
||||||
<meta-data android:name="com.gcm.push.api.key" android:value="" />
|
|
||||||
|
|
||||||
<!-- 消息接收监听器 (用户可自主扩展) -->
|
|
||||||
<receiver
|
|
||||||
android:name="cn.starlock.lock.MyMessageReceiver"
|
|
||||||
android:exported="false" > <!-- 为保证receiver安全,建议设置不可导出,如需对其他应用开放可通过android:permission进行限制 -->
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_OPENED" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.alibaba.push2.action.NOTIFICATION_REMOVED" />
|
|
||||||
</intent-filter>
|
|
||||||
<intent-filter>
|
|
||||||
<action android:name="com.alibaba.sdk.android.push.RECEIVE" />
|
|
||||||
</intent-filter>
|
|
||||||
</receiver>
|
|
||||||
</application>
|
|
||||||
|
|
||||||
</manifest>
|
|
||||||
@ -57,6 +57,8 @@ flavors:
|
|||||||
icon: "assets/icon/dev.png"
|
icon: "assets/icon/dev.png"
|
||||||
android:
|
android:
|
||||||
applicationId: "com.starlock.lock.dev"
|
applicationId: "com.starlock.lock.dev"
|
||||||
|
customConfig:
|
||||||
|
signingConfig: signingConfigs.pre
|
||||||
ios:
|
ios:
|
||||||
bundleId: "com.starlock.lock.dev"
|
bundleId: "com.starlock.lock.dev"
|
||||||
pre:
|
pre:
|
||||||
@ -65,6 +67,8 @@ flavors:
|
|||||||
icon: "assets/icon/pre.png"
|
icon: "assets/icon/pre.png"
|
||||||
android:
|
android:
|
||||||
applicationId: "com.starlock.lock.pre"
|
applicationId: "com.starlock.lock.pre"
|
||||||
|
customConfig:
|
||||||
|
signingConfig: signingConfigs.pre
|
||||||
ios:
|
ios:
|
||||||
bundleId: "com.starlock.lock.pre"
|
bundleId: "com.starlock.lock.pre"
|
||||||
sky:
|
sky:
|
||||||
|
|||||||
@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
|||||||
# In Windows, build-name is used as the major, minor, and patch parts
|
# In Windows, build-name is used as the major, minor, and patch parts
|
||||||
# of the product and file versions while build-number is used as the build suffix.
|
# of the product and file versions while build-number is used as the build suffix.
|
||||||
|
|
||||||
version: 1.0.11+20240305
|
version: 1.0.11+20240306
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: '>=2.12.0 <3.0.0'
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user