- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我已经从 3.1.1 更新到 Gradle 发行版 5.1.1,它涉及很多更改,包括更新 androidX 支持库。出于某种原因,build 一直未能要求更改 versionName 在 merged flavor 中的设置方式。我无法弄清楚我到底错过了什么,已经添加了 gradle 构建结果建议的代码。
构建.gradle
buildscript {
ext.kotlin_version = '1.3.40'
System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://nexus.dminc-gtc.com/nexus/content/groups/public/' }
maven { url "https://jitpack.io" }
maven { url 'https://maven.google.com' }
maven { url 'https://repo.spring.io/libs-milestone' }
mavenLocal()
maven {
url 'https://maven.google.com/'
name 'Google'
}
maven { url "https://plugins.gradle.org/m2/" }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
//annotationProcessor 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'com.dminc.gradle:android-release-plugin:1.0.0'
classpath 'io.fabric.tools:gradle:1.27.1'
classpath 'com.github.triplet.gradle:play-publisher:1.1.5'
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.5"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.0.1'
classpath 'com.github.alexfu:androidautoversion:3.0.2'
}
}
repositories {
maven { url 'https://maven.fabric.io/public' }
maven { url 'https://nexus.dminc-gtc.com/nexus/content/groups/public/' }
mavenLocal()
mavenCentral()
jcenter()
flatDir {
dirs 'libs'
}
maven { url "https://jitpack.io" }
maven { url 'http://maven.localytics.com/public' }
maven { url 'https://maven.google.com' }
maven { url 'https://repo.spring.io/libs-milestone' }
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
//apply plugin: 'android-apt'
apply plugin: 'android-release-plugin'
apply plugin: 'com.google.gms.google-services'
apply from: 'checkstyle.gradle'
apply from: 'pmd.gradle'
apply from: 'findbugs.gradle'
apply plugin: 'com.github.triplet.play'
apply from: 'sonar.gradle'
apply plugin: 'com.github.alexfu.androidautoversion'
ext.androidAnnotationsVersion = '4.6.0'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 28
defaultConfig {
// These are applied to the manifest, to prevent nasty compat modes, use the latest you can.
minSdkVersion 19
targetSdkVersion 28
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
}
releaseConfig {
// Set to true to add the version number from the apk name (default is false)
addVersionToApk false
// No default for propertyFile, you HAVE to specify it, it will be interpreted by the plugin as follow: [root_dir]/[propertyFile]
propertyFile "version.properties"
}
flavorDimensions 'white_label', 'server'
productFlavors {
newmoove {
// Assigns this product flavor to the "version" flavor dimension.
// This property is optional if you are using only one dimension.
dimension "white_label"
applicationId 'com.app.newmoove'
manifestPlaceholders = [crashlyticsApiKey: "*******************",
facebookAppId : "*************"]
}
wexer {
// Assigns this product flavor to the "version" flavor dimension.
// This property is optional if you are using only one dimension.
dimension "white_label"
applicationId 'com.app.wexer'
manifestPlaceholders = [crashlyticsApiKey: "*********************",
facebookAppId : "*************"]
}
customfit {
// Assigns this product flavor to the "version" flavor dimension.
// This property is optional if you are using only one dimension.
dimension "white_label"
applicationId 'com.appname.app'
manifestPlaceholders = [crashlyticsApiKey: "**********************"]
}
dev {
dimension "server"
applicationIdSuffix ".devtest"
versionNameSuffix "-dev"
}
integration {
dimension "server"
applicationIdSuffix ".integration"
versionNameSuffix "-integration"
}
staging {
dimension "server"
applicationIdSuffix ".staging"
versionNameSuffix "-staging"
}
live {
dimension "server"
}
}
// A lot of 3rd party libraries contain similar stuff.
packagingOptions {
exclude 'LICENSE.*'
exclude 'NOTICE.*'
exclude 'META-INF/services/javax.annotation.processing.Processor'
}
lintOptions {
quiet true
abortOnError false
ignoreWarnings true
}
applicationVariants.all { variant ->
variant.outputs.each { output ->
output.versionNameOverride = "5.0.1.91-5.0.1"
}
}
}
dependencies {
implementation fileTree(include: '*.jar', dir: 'libs')
implementation(name: 'Android-ViewPagerIndicator', ext: 'aar')
implementation(name: 'Fontify-release', ext: 'aar')
implementation(name: 'HoloGraphLibrary-release', ext: 'aar')
implementation(name: 'slidingmenu-release', ext: 'aar')
implementation 'com.mani:ThinDownloadManager:1.3.0'
implementation 'com.github.johnkil.print:print:1.3.1'
implementation 'com.nhaarman.listviewanimations:lib-core:3.1.0@aar'
implementation 'com.nhaarman.listviewanimations:lib-manipulation:3.1.0@aar'
implementation 'com.edmodo:rangebar:1.0.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'de.greenrobot:eventbus:2.4.1'
implementation 'com.github.johnkil.android-appmsg:appmsg:1.2.0'
implementation 'com.path:android-priority-jobqueue:1.1.2'
implementation 'com.fasterxml.jackson.core:jackson-core:2.9.0'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.9.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.9.0'
implementation 'com.j256.ormlite:ormlite-android:5.0'
implementation 'com.github.gabrielemariotti.cards:library:1.9.1'
implementation 'se.emilsjolander:stickylistheaders:2.7.0'
implementation 'com.google.code.gson:gson:2.3.1'
implementation 'com.google.android.gms:play-services-analytics:11.2.0'
implementation 'com.google.android.gms:play-services-maps:11.2.0'
implementation 'com.google.android.gms:play-services-location:11.2.0'
implementation 'com.google.android.gms:play-services-auth:11.2.0'
implementation 'com.google.android.gms:play-services-fitness:11.2.0'
implementation 'com.google.android.gms:play-services-ads:11.2.0'
implementation 'com.google.firebase:firebase-messaging:11.2.0'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
testImplementation 'org.robolectric:robolectric:3.4'
implementation 'com.facebook.android:facebook-android-sdk:4.+'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') {
transitive = true;
}
implementation 'com.soundcloud.android:android-crop:1.0.1@aar'
debugImplementation 'com.squareup.leakcanary:leakcanary-android:1.5.1'
// or 1.4-beta1
releaseImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
// or 1.4-beta1
testImplementation 'com.squareup.leakcanary:leakcanary-android-no-op:1.5.1'
// or 1.4-beta1
implementation 'com.localytics.android:library:5.4.0'
implementation 'com.github.tony19:timber-loggly:1.0.1'
implementation 'com.daimajia.swipelayout:library:1.2.0@aar'
implementation 'com.github.mmin18:realtimeblurview:1.1.0'
implementation 'org.apache.httpcomponents:httpclient:4.5.9'
implementation 'com.andkulikov:transitionseverywhere:1.7.5'
implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'
implementation 'net.danlew:android.joda:2.9.9'
implementation 'androidx.multidex:multidex:2.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation('com.devbrackets.android:exomedia:4.0.3') {
exclude(module: 'support-v4')
exclude(module: 'appcompat-v7')
}
implementation 'org.springframework.android:spring-android-rest-template:2.0.0.M4'
implementation 'com.github.PhilJay:MPAndroidChart:v2.1.4'
implementation "org.androidannotations:androidannotations:${androidAnnotationsVersion}"
implementation "org.androidannotations:androidannotations-api:${androidAnnotationsVersion}"
implementation "org.androidannotations:rest-spring-api:${androidAnnotationsVersion}"
implementation "org.androidannotations:rest-spring:${androidAnnotationsVersion}"
implementation "org.androidannotations:ormlite-api:${androidAnnotationsVersion}"
implementation "org.androidannotations:ormlite:${androidAnnotationsVersion}"
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.stripe:stripe-android:6.1.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation('androidx.cardview:cardview:1.0.0') {
force = true
}
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'com.otaliastudios:nestedscrollcoordinatorlayout:1.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//rx
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'io.reactivex.rxjava2:rxjava:2.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
implementation 'com.google.firebase:firebase-core:11.2.0'
implementation 'com.google.firebase:firebase-invites:11.2.0'
implementation group: 'com.neenbedankt.gradle.plugins', name: 'android-apt', version: '1.8'
}
无论我做什么,在构建项目时都无法通过以下错误。
最佳答案
在 build.gradle 中进行此更改(在错误窗口中建议)并进行干净的构建。
关于android - versionName 不能直接在 mergedFlavor 上设置,更新到 gradle 5.1.1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56742072/
我想使用不同的 versionCode和 versionName用于调试和发布版本,但我不确定如何实现这一点。我不想只添加后缀,我想在两种构建类型之间生成完全不同的 versionCode。具体来说,
我已将我的应用程序的这些版本上传到 Google Play: VersionCode VersionName 1 1
为了改进错误报告,我希望标签 android:versionName 自动包含 svn 服务器上的修订号。任何人都知道该怎么做?谢谢 ` 最佳答案 尝试 svn:keywords . 关于androi
Android 对 versionName 有要求吗?它可以是任意字符串吗,比如 Ubuntu 的版本(Bionic Beaver 等) 最佳答案 选择versionName没有任何限制。您可以使用“
我想在我的应用程序信息(关于)页面中显示 AndroidManifest 中的 android:versionName。有什么办法吗? 最佳答案 android:versionName="@strin
在我的应用程序级别build.gradle文件中,我具有版本名称,例如 versionName "1.03" 在Android Studio中构建签名发行版.apk时,输出文件名为 app-relea
这个问题在这里已经有了答案: How can you get the build/version number of your Android application? (36 个答案) 关闭 8
我正在尝试在我的 Android 应用程序中实现风格。我有以下 build.gradle 文件: plugins { id "com.company.versioning" version "
如何获取 fragment 中的版本名称?下面的代码不起作用: PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageNam
我想在每次发布 apk 时更改 android:versionName。 是否有任何eclipse插件或其他一些方法可以帮助它随着我的代码编译而自动更改? 例如,今天是 10/09/2011,我希望将
我创建了一个库项目,并将其导入到另一个项目中。在那个图书馆项目中,我在某个时候检索到它是 android:versionName为此,您需要提供包名称。当图书馆项目包含在另一个项目中时执行该代码时会出
我想使用 shell 命令从 AndroidManist.xml 文件中获取版本名称。我一直在尝试使用 grep 和: grep versionName ./AndroidManifest.xml
到目前为止,我一直专注于我的应用程序的编程,很少关注使构建过程更智能。因此,我一直在手动操作(“笨方法”),包括在 AndroidManifest.xml 中手动更新 android:versionC
我正在开发一个 Android 应用程序,其中 95% 的功能都包含在我编写的库中。同一个库将用于 30 多个应用程序,我希望不必手动设置每个应用程序的版本。相反,我想设置应用程序的 versionN
我只是尝试将我的 Android 应用程序的版本名称从 1.0 更改为 1.0.1,将代码从 1 更改为 2,但每次我在 Eclipse 中导出项目时,它都会自动更改回来。有人可以帮助我吗? 这是我的
有没有办法从 xml 访问我的 build.gradle 中的 versionName ?我想用这个值设置 TextView 的文本。 或者也许可以在 strings.xml 中声明一个版本的字符串并
我最近更新了我的 Android 应用程序 7 次,但直到现在我都按照我的意愿分配 VersionName。但是,现在我想知道是否有任何特定的规则或方法可以将 VersionName 分配给 Andr
下面是我的一个图书馆项目的 list 。目前我每次更改都会增加 versionCode 和 versionName。这是必需的吗? 提前致谢。 最佳答案 当前,在构
我想知道如何解析 AndroidManifest.xml 文件,以便通过代码获取应用程序版本号。 android:versionName 最佳答案 无需为此解析 AndroidManifest.xml
我正在尝试将 epub 阅读器库添加到我已经创建的项目中。我试图作为模块添加到我的项目中的库是 Folio Reader Library (https://github.com/FolioReader
我是一名优秀的程序员,十分优秀!