Comments (6)
不知道你这里构建的时候,dist目录中有没有生成安装包,如果没有的话,跟我的情况可能一致
我是把android app里面的applicationVariants.configureEach处理安装包名称这个删掉后,构建后才正常在dist中生成安装包
from flutter_distributor.
从0.3.1版本开始上传apk失败,现在也无法降级到0.2.8版本,具体日志信息如下:
Running Gradle task 'assembleRelease'... 63.5s
✓ Built build/app/outputs/flutter-apk/app-release.apk (17.2MB).
{
"config": {
"mode": "release",
"arguments": {
"target": "lib/main.dart",
"target-platform": "android-arm64"
}
},
"outputDirectory": "build/app/outputs/apk/release",
"duration": 67472,
"outputFiles": []
}
Successfully built Directory: 'build/app/outputs/apk/release' in 67s
Bad state: No element
#0 List.first (dart:core-patch/growable_array.dart:343:5)
#1 AppPackageMakerApk.make (package:flutter_app_packager/src/makers/apk/app_package_maker_apk.dart:13:29)
#2 FlutterAppPackager.package (package:flutter_app_packager/src/flutter_app_packager.dart:40:18)
#3 FlutterDistributor.package (package:flutter_distributor/src/flutter_distributor.dart:181:51)
#4 FlutterDistributor.release (package:flutter_distributor/src/flutter_distributor.dart:320:45)
#5 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
RELEASE FAILED in 71s
Bad state: No element
#0 List.first (dart:core-patch/growable_array.dart:343:5)
#1 AppPackageMakerApk.make (package:flutter_app_packager/src/makers/apk/app_package_maker_apk.dart:13:29)
#2 FlutterAppPackager.package (package:flutter_app_packager/src/flutter_app_packager.dart:40:18)
#3 FlutterDistributor.package (package:flutter_distributor/src/flutter_distributor.dart:181:51)
#4 FlutterDistributor.release (package:flutter_distributor/src/flutter_distributor.dart:320:45)
#5 CommandRunner.runCommand (package:args/command_runner.dart:212:13)
其中:
"outputDirectory": "build/app/outputs/apk/release",
"duration": 67472,
"outputFiles": []
这个并不是我配置文件里的内容,不知道outputDirectory怎么会变成apk/release,而不是flutter-apk/release的。导致dist目录没有拷贝过来的apk而上传失败。不过可以通过手动运行:
flutter_distributor publish --path ./build/app/outputs/flutter-apk/app-release.apk --targets pgyer
会成功并显示日志:
[pgyer]
Publishing to pgyer: ████████████████████████████████████████ 18026909/18026909 100.0%
from flutter_distributor.
@QQQOOO @davidche1116 Please provide the content of your build.gradle
from flutter_distributor.
@lijy91
android/build.gradle:
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
maven {url 'https://maven.aliyun.com/repository/public'}
maven {url 'https://maven.aliyun.com/repository/central'}
maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven {url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
google()
mavenCentral()
jcenter()
maven {url 'https://developer.huawei.com/repo/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.huawei.agconnect:agcp:1.7.3.300'
}
}
allprojects {
repositories {
maven {url 'https://maven.aliyun.com/repository/public'}
maven {url 'https://maven.aliyun.com/repository/central'}
maven {url 'https://maven.aliyun.com/repository/gradle-plugin'}
maven {url 'https://maven.aliyun.com/nexus/content/repositories/jcenter'}
google()
mavenCentral()
jcenter()
maven {url 'https://developer.huawei.com/repo/'}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
android/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'
}
def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.huawei.agconnect'
android {
compileSdkVersion flutter.compileSdkVersion
ndkVersion flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.android.applicationId"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
// minSdkVersion flutter.minSdkVersion
minSdkVersion 21
// targetSdkVersion flutter.targetSdkVersion
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
debug {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}
buildTypes {
debug {
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'armeabi', 'armeabi-v7a', 'x86', 'x86_64', 'arm64-v8a'
}
//签名
signingConfig signingConfigs.release
//移除无用的resource文件
shrinkResources false
//开启混淆
minifyEnabled false
// useProguard true
//指定混淆保留规则文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
release {
ndk {
//选择要添加的对应 cpu 类型的 .so 库。
abiFilters 'arm64-v8a'
//abiFilters 'armeabi-v7a', 'arm64-v8a'
}
// Signing with the debug keys for now, so `flutter run --release` works.
//签名
signingConfig signingConfigs.release
//移除无用的resource文件
shrinkResources false
//资源压缩设置
minifyEnabled false
// useProguard true //代码压缩设置
//指定混淆保留规则文件
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
// OPPO推送添加
repositories {
flatDir {
dirs 'libs'
}
}
}
dependencies {
//3D地图so及jar,使用3D地图必须去除定位依赖
//implementation 'com.amap.api:3dmap:9.6.2'
// 高德定位
implementation 'com.amap.api:location:latest.integration'
// 荣耀推送添加
implementation(name: 'HiPushSDK-v7.0.1.103', ext: 'aar')
// OPPO推送添加
implementation(name: 'com.heytap.msp_3.1.0', ext: 'aar')
implementation 'com.google.code.gson:gson:2.6.2'
implementation 'commons-codec:commons-codec:1.6'
implementation 'androidx.annotation:annotation:1.1.0'
// 华为推送额外依赖
implementation 'com.huawei.hms:push:6.7.0.300'
//厂商版本和JPush SDK版本保持一致jpush_flutter2.4.4版的jpush版本为5.0.0
implementation 'cn.jiguang.sdk.plugin:meizu:5.0.0'
implementation 'cn.jiguang.sdk.plugin:xiaomi:5.0.0'
implementation 'cn.jiguang.sdk.plugin:huawei:5.0.0'
implementation 'cn.jiguang.sdk.plugin:vivo:5.0.0'
implementation 'cn.jiguang.sdk.plugin:oppo:5.0.0'
implementation 'cn.jiguang.sdk.plugin:honor:5.0.0'
// 腾讯Bugly最新依赖
implementation 'com.tencent.bugly:crashreport:4.1.9.2'
// 友盟基础组件库(所有友盟业务SDK都依赖基础组件库)
implementation 'com.umeng.umsdk:common:9.6.1'// (必选)
implementation 'com.umeng.umsdk:asms:1.8.0'// 必选
}
flutter {
source '../..'
}
from flutter_distributor.
@davidche1116 方便加一下我的微信吗 lijy91
from flutter_distributor.
请更新到 0.3.3
from flutter_distributor.
Related Issues (20)
- macos build failed /bin/sh: 7z: command not found
- FormatException: Missing extension byte (at offset 9) HOT 1
- makers/AppImage: LD_LIBRARY_PATH poorly configured in AppRun
- [Linux][AppImage] Not showing correct icon
- Build fails with an exception when building for Windows HOT 2
- 蒲公英换网址了? HOT 3
- AppImage packaging failed when copying shared libraries HOT 3
- 如何配置Release路径?Directory listing failed, path = 'build/windows/runner/Release\*' HOT 4
- Add support for `flutter build` option `--dart-define-from-file=` HOT 1
- flutter_distributor "package" how to specify "output" using commands HOT 1
- Windows Build Fails on Custom Flutter branch
- When building the .exe package, how to configure codesign? HOT 2
- add google play example document HOT 1
- App build number is set to build name when not provided
- Error when packing DEB package: end of file before value of field 'Uploaders' (missing final newline)
- Cannot install on windows11 HOT 1
- [Linux][deb,rpm] desktop file should not set [Version]
- [Android] target-platform builder error HOT 1
- 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
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.