Comments (5)
可以提供一下你的 build.gradle 的配置吗?
from flutter_distributor.
可以提供一下你的 build.gradle 的配置吗?
好的。下面是app模块下的build.gradle内容
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.0'
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
android {
compileSdkVersion rootProject.ext.android["compileSdkVersion"]
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
defaultConfig {
applicationId rootProject.ext.app["applicationId"]
minSdkVersion rootProject.ext.android["minSdkVersion"]
targetSdkVersion rootProject.ext.android["targetSdkVersion"]
versionCode rootProject.ext.app["versionCode"]
versionName rootProject.ext.app["versionName"]
manifestPlaceholders = [TENCENT_APP_ID: "appId"]
multiDexEnabled true
ndk{
abiFilters "armeabi-v7a","arm64-v8a"
}
configurations.all {
resolutionStrategy {
force 'androidx.core:core:1.6.0'
force 'androidx.core:core-ktx:1.6.0'
}
}
}
signingConfigs {
debug {
storeFile file(project.hasProperty('RELEASE_STORE_FILE') ? RELEASE_STORE_FILE : System.getenv('RELEASE_STORE_FILE'))
storePassword project.hasProperty('RELEASE_STORE_PASSWORD') ? RELEASE_STORE_PASSWORD : System.getenv('RELEASE_STORE_PASSWORD')
keyAlias project.hasProperty('RELEASE_KEY_ALIAS') ? RELEASE_KEY_ALIAS : System.getenv("RELEASE_KEY_ALIAS")
keyPassword project.hasProperty('RELEASE_KEY_PASSWORD') ? RELEASE_KEY_PASSWORD : System.getenv("RELEASE_KEY_PASSWORD")
// No debug config
}
release {
storeFile file(RELEASE_STORE_FILE)
storePassword RELEASE_STORE_PASSWORD
keyAlias RELEASE_KEY_ALIAS
keyPassword RELEASE_KEY_PASSWORD
}
}
buildTypes {
debug {
minifyEnabled false
zipAlignEnabled false
// 移除无用的resource文件
shrinkResources false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters "armeabi", "armeabi-v7a","arm64-v8a"
}
}
profile {
minifyEnabled false
zipAlignEnabled false
// 移除无用的resource文件
shrinkResources false
signingConfig signingConfigs.debug
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk {
abiFilters "armeabi", "armeabi-v7a","arm64-v8a"
}
}
release {
minifyEnabled true
zipAlignEnabled true
// 移除无用的resource文件
shrinkResources true
signingConfig signingConfigs.release
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
ndk{
abiFilters "armeabi-v7a","arm64-v8a"
}
}
}
lintOptions {
disable 'InvalidPackage'
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
flavorDimensions "mode"
productFlavors {
huiwei {}
}
// 自定义APK安装包名
applicationVariants.all { variant ->
variant.outputs.all { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName = "student_v${defaultConfig.versionName}_${buildTime()}.apk"
outputFileName = fileName
}
}
}
buildFeatures {
dataBinding = true
}
}
def buildTime() {
return new Date().format("yyyy-MM-dd HH:MM:ss" , TimeZone.getTimeZone("UTC"))
}
flutter {
source '../..'
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.multidex:multidex:2.0.1'
implementation ('com.github.bumptech.glide:glide:4.11.0') {
exclude group: "com.android.support"
}
kapt 'com.github.bumptech.glide:compiler:4.11.0'
}
from flutter_distributor.
@hfbi360 看起来是因为 build.gradle
中增加了自定义APK安装包名的配置,导致输出目录不是默认目录导致,请移除这部分配置后重试
from flutter_distributor.
请更新到 0.3.3 后重试
from flutter_distributor.
请更新到 0.3.3 后重试
多谢
from flutter_distributor.
Related Issues (20)
- Why does it seem like it doesn't support environment variables
- [Linux] like electron application, binary file should place in /opt rather than /usr/share
- [MacOS]How to notarize a dmg file HOT 2
- Windows 能不能 加一个可以修改安转路径的配置,不要用默认 OutputDir=. 的配置,谢谢。 HOT 3
- type 'Null' is not a subtype of type 'Map<String, dynamic>' HOT 4
- Add support to specify metainfo or path of metainfo for linux
- Support .pacman format
- 我想请问一下 exe 程序快捷应用名怎么修改? HOT 3
- Please upgrade uuid to v4 HOT 4
- Could not find `bin/flutter_distributor.dart` in package `flutter_distributor`. HOT 1
- Q: Does it obfuscate the code? HOT 1
- MakeError when packaging to AppImage for aarch64 from Raspberry Pi HOT 1
- [msix]: type 'Null' is not a subtype of type 'FutureOr<String>' HOT 1
- Please add `--dart-define-from-file` parameter to `flutter_distributor package` HOT 1
- Support set track for playstore deployment
- [Linux] postuninstall_scripts we're not removing mentioned folders
- 可否支持生成无签名的 IPA 文件?
- On Linux arm64, an error occurs when building AppImage. HOT 1
- On Linux arm64, an error occurs when building RPM. HOT 1
- 请问target-platform的配置还有哪几个选项?我看你们官方的示例代码写的android-arm,android-arm64 HOT 1
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 flutter_distributor.