- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我的应用程序在 Android 11 设备上开始崩溃,并显示以下错误消息 “您应用的 AndroidManifest.xml 中的元数据标签没有正确的值。预期为 12451000,但发现为 4323000” .我知道这些问题,并且我已经在 list 文件中定义了正确的值,如下所示:
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
如果我关注 google_play_services_version 我可以找到预期值
<integer name="google_play_services_version">12451000</integer>
在 firebase 分析的帮助下,我可以确认它仅在 Android 11 设备上发生。
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"
tools:replace="android:value" />
3- 检查所有使用的第 3 部分 libs/SDK list 文件中的 @integer/google_play_services_version,但都重定向到预期值,即 12451000。
apply from: '../release-config.gradle'
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'android-release-plugin'
apply plugin: 'testfairy'
apply from: '../sonar.gradle'
apply from: '../jacoco.gradle'
// Add the Firebase Crashlytics plugin.
apply plugin: 'com.google.firebase.crashlytics'
android.testOptions {
unitTests.all {
jacoco {
includeNoLocationClasses = true
}
}
unitTests.returnDefaultValues = true
}
tasks.sonarqube.dependsOn jacocoTestReport
android {
compileSdkVersion 30
buildToolsVersion '29.0.2'
ndkVersion "16.1.4479499"
kapt {
javacOptions {
option("-Adagger.gradle.incremental")
option("-Adagger.formatGeneratedSource=disabled")
}
}
dexOptions {
javaMaxHeapSize "4g"
}
defaultConfig {
applicationId "com.xx”
minSdkVersion 23
targetSdkVersion 30
multiDexEnabled true
testInstrumentationRunner
"androidx.test.runner.AndroidJUnitRunner"
buildConfigField "String", "SERVER_BASE", ‘”————“’
buildConfigField "String", "LOCUSLABS_ACCOUNT_ID", ‘”——“’
buildConfigField "String", "GCM_SENDER_ID", ‘”———“’
buildConfigField "String", "GRAB_ID", ‘”———“’
buildConfigField "String", "GCT_CONVERSION_ID", ‘”———“’
buildConfigField "String", "GCT_LABEL", ‘”———“’
buildConfigField "String", "GCT_VALUE", ‘”——“’
}
signingConfigs {
}
buildTypes {
debug {
versionNameSuffix "(Debuggable)"
debuggable true
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
release {
shrinkResources true
signingConfig signingConfigs.release
zipAlignEnabled true
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
debuggable false
}
}
flavorDimensions 'environment'
productFlavors {
dev {
applicationIdSuffix ".dev"
buildConfigField "String", "SERVER_BASE", ‘”——————‘
def internalVersion =
releaseConfig.getAppVersion().internalVersion
resValue "string", "app_name", "xx (Test) ${internalVersion}"
}
stage {
applicationIdSuffix ".stage"
buildConfigField "String", "SERVER_BASE", ‘”—————“’—
def internalVersion =
releaseConfig.getAppVersion().internalVersion
resValue "string", "app_name", "xx (Stage) ${internalVersion}"
}
prod {
buildConfigField "String", "SERVER_BASE", ‘”———“’——
buildConfigField "String", "LOCUSLABS_ACCOUNT_ID", ‘”———“’
buildConfigField "String", "GCM_SENDER_ID", ‘”——“’
buildConfigField "String", "GRAB_ID", ‘”——“’
buildConfigField "String", "GCT_CONVERSION_ID", ‘”———“’
buildConfigField "String", "GCT_LABEL", ‘”———“’
}
}
packagingOptions {
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/ASL2.0'
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
exclude 'META-INF/**rxjava.properties**'
}
lintOptions {
abortOnError false
}
testfairyConfig {
apiKey “———————“
}
testOptions {
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
androidExtensions {
experimental = true
}
}
def powermock_version = "2.0.2"
def daggerVersion = "2.16"
def leak_canary_version = "2.0-beta-1"
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation project(':common')
implementation('com.facebook.android:facebook-android-sdk:5.15.3') {
exclude group: 'com.android.support'
}
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.cardview:cardview:1.0.0'
implementation "androidx.constraintlayout:constraintlayout:2.0.2"
implementation "com.google.android.gms:play-services-base:17.4.0"
implementation "com.google.android.gms:play-services-location:17.1.0"
implementation "com.google.android.gms:play-services-maps:17.0.0"
implementation "com.google.android.gms:play-services-vision:20.1.2"
implementation "com.google.android.gms:play-services-wearable:17.0.0"
implementation 'androidx.core:core:1.3.2'
implementation 'com.romandanylyk:pageindicatorview:1.0.3'
implementation 'com.getbase:floatingactionbutton:1.10.1'
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'
// need by grab sdk
implementation 'androidx.viewpager2:viewpager2:1.0.0'
implementation 'com.github.JakeWharton:ViewPagerIndicator:2.4.1'
implementation('com.squareup.retrofit2:retrofit:2.5.0') {
// exclude Retrofit’s OkHttp peer-dependency module and define
your own module import
exclude module: 'okhttp'
}
implementation 'com.squareup.retrofit2:adapter-rxjava2:2.3.0'
implementation 'com.squareup.okhttp3:okhttp:3.12.1'
implementation 'com.squareup.okhttp3:logging-interceptor:3.9.1'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.google.zxing:core:3.3.3'
implementation 'io.reactivex.rxjava2:rxjava:2.1.10'
implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
implementation 'com.airbnb.android:lottie:2.5.5'
implementation 'me.grantland:autofittextview:0.2.1'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
kapt 'com.github.bumptech.glide:compiler:4.11.0'
implementation 'org.kamranzafar:jtar:2.2'
implementation 'org.tukaani:xz:1.5'
implementation 'io.reactivex:rxjava:1.3.0'
implementation 'io.reactivex:rxandroid:1.2.1'
implementation(name: 'locuslabs-android-sdk-2.3.10', ext: 'aar') {
transitive = true
}
implementation 'com.facebook.soloader:soloader:0.9.0'
implementation 'com.facebook.litho:litho-core:0.38.0'
implementation 'com.facebook.litho:litho-widget:0.38.0'
compileOnly 'com.facebook.litho:litho-annotations:0.38.0'
kapt 'com.facebook.litho:litho-processor:0.38.0'
// Firebase Dependencies
implementation "com.google.firebase:firebase-messaging:20.3.0"
// Add the Firebase Crashlytics SDK.
implementation 'com.google.firebase:firebase-crashlytics:17.2.2'
// Add the Firebase SDK for Google Analytics
implementation 'com.google.firebase:firebase-analytics:17.6.0'
implementation "com.google.firebase:firebase-core:17.5.1"
// Grab Dependencies
implementation(name: 'grab-framework-1.1.33', ext: 'aar')
implementation 'com.braintreepayments.api:braintree:2.16.0'
implementation 'com.android.volley:volley:1.1.1'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'de.hdodenhof:circleimageview:2.0.0'
implementation 'org.kamranzafar:jtar:2.2'
implementation group: 'com.googlecode.libphonenumber', name:
'libphonenumber', version: '8.4.1'
implementation 'io.card:android-sdk:5.5.1'
api 'com.wunderlist:sliding-layer:1.2.5'
// Background Process
implementation 'com.evernote:android-job:1.4.2'
// Dagger
implementation "com.google.dagger:dagger-android:$daggerVersion"
implementation "com.google.dagger:dagger-android-support:$daggerVersion"
kapt "com.google.dagger:dagger-android-processor:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
// Paging
implementation 'androidx.paging:paging-runtime:2.1.2'
// Lifecycle
implementation "androidx.lifecycle:lifecycle-runtime:2.2.0"
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
kapt "androidx.lifecycle:lifecycle-compiler:2.2.0"
// Utils
implementation 'com.jakewharton.timber:timber:4.7.1'
//For updating styles attributes dynamically
implementation 'com.airbnb.android:paris:1.7.1'
// A memory leak detection library.
debugImplementation "com.squareup.leakcanary:leakcanary-android:${leak_canary_version}"
implementation "com.squareup.leakcanary:leakcanary-object-watcher-android:${leak_canary_version}"
implementation 'com.intuit.sdp:sdp-android:1.0.6'
wearApp project(':wearable')
//Test
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'
testImplementation "org.powermock:powermock-module-junit4:${powermock_version}"
testImplementation "org.powermock:powermock-module-junit4-rule:${powermock_version}"
testImplementation "org.powermock:powermock-api-mockito2:${powermock_version}"
testImplementation "org.powermock:powermock-classloading-xstream:${powermock_version}"
androidTestImplementation('androidx.test.espresso:espresso-core:3.3.0') {
exclude group: 'com.google.code.findbugs'
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestImplementation('androidx.test:runner:1.3.0') {
exclude group: 'com.android.support', module: 'support-annotations'
}
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation ("com.github.tomeees:scrollpicker:1.7.4")
}
apply plugin: 'com.google.gms.google-services'
B- 顶级 build.gradle 文件:
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
maven { url "http://www.bugsense.com/gradle/" }
mavenLocal()
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath 'com.dminc.gradle:android-release-plugin:1.1.0.6'
classpath 'com.testfairy.plugins.gradle:testfairy:2.0'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.6.2'
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
flatDir { dirs 'libs' }
mavenLocal()
mavenCentral()
google()
}
}
我正在从我的启动画面 {午餐 Activity } 检查 Play 服务的可用性。我什至试图通过应用 try-catch 来捕获抛出的异常并能够成功捕获它,但应用程序仍然崩溃:
public static int checkPlayServices(Context activity) {
int retValue;
try {
int resultCode = GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(activity);
Timber.tag(TAG).d( "This device is supported with api version%s",
GoogleApiAvailability.getInstance().getClientVersion(activity));
if (resultCode != ConnectionResult.SUCCESS) {
if (GoogleApiAvailability.getInstance().isUserResolvableError(resultCode)) {
retValue = PLAY_STORE_RESOLVABLE_ERROR;
Timber.tag(TAG).d( "This device is supported but can be resolved.");
} else {
Timber.tag(TAG).d( "This device is not supported and cannot be resolved.");
retValue = PLAY_STORE_UN_SUPPORT;
}
} else {
retValue = PLAY_STORE_AVAILABLE;
}
} catch (java.lang.IllegalStateException e) {
Timber.tag(TAG).d( "This device Throws Illegal state Exception. Probably caused by google_play_services_version");
Timber.tag(TAG).e( e.getMessage());
retValue = PLAY_STORE_VERSION_ERROR;
} catch (java.lang.Exception e) {
Timber.tag(TAG).d( "This device Throws Exception. Exact Reason is unknown");
Timber.tag(TAG).e( e.getMessage());
retValue = PLAY_STORE_ERROR;
}
return retValue;
}
我能够 catch ,但应用程序仍然崩溃,这让我想到另一个想法,可能是其他一些 SDK 依赖项引发了这个异常。我检查了所有第 3 个 SDK,发现另外两个 SDK 的 {Facebook 和 Braintree 付款也在检查 Google Play 服务}。
最佳答案
问题已修复。
只需更改元标记的顺序。版本标签应始终排在第一位。
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/google_api_key"
tools:replace="android:value" />
关于Android 11 应用程序崩溃并出现 "The meta-data tag in your app' s AndroidManifest.xml 没有正确的值。预期为 12451000,但发现为 4323000",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64278090/
我的android studio版本是3.4.0。 Gradle版本为3.4.0。我尝试清理项目,重新安装Android Studio,修改了Project Setting Build选项。到目前为止
我的应用程序仅由一个 application 模块组成。我最近试图将它分成 2 个模块(一个 feature 基础和一个 application apk 一个)以便稍后添加一个 instant-app
我正在尝试 http://developer.android.com/ 上的教程并在 AndroidManifest.xml 文件上遇到错误。发生的事情是,我在创建 Activity 时犯了一个错误(
我正在尝试将我的 ionic 3 应用程序 list 中的 allowBackup 属性设置为 false,但 gradle 提示出现以下错误: 来自 AndroidManifest.xml:4:18
我在我的 android 应用程序的 AndroidMenifest.xml 文件中遇到了以下两行: 为什么我们在 中写“编码”标签,它的用途是什么? 写第二行的目的是什么? 如果有人知道这一点
是否有任何独立的(独立于 Eclipse 或 IDE 特定的)工具可以检查 AndroidManifest.xml 文件是否有错误? 我最近遇到了一个恼人的问题,我输入了 reciever 而它本应该
我的一个项目的 AndroidManifest.xml 变得越来越大(> 1000 行),因为我必须对某些文件类型使用react并且涵盖所有情况变得越来越复杂。我想知道 list 大小是否有任何限制。
我的 AndroidManifest.xml 文件没有创建应有的启动器图标。 XML 如下:
AndroidManifest.xml配置文件对于Android应用开发来说是非常重要的基础知识,本文旨在总结该配置文件中重点的用法,以便日后查阅。下面是一个标准的AndroidManifest.x
我正在尝试使用eclipse中的gradle构建一个android应用程序,并且我试图在项目根目录中使用命令gradle build 构建apk, 我在 $projdir/build/intermed
简单的问题,但经过长时间的谷歌搜索,我还没有看到一个好的答案。 我有 2 种内置类型:调试、发布 我有 2 种口味:口味 1、口味 2 这将创建 4 个变体。 调试 + flavor 1 释放+ fl
我有这个错误 I/Ads (21352): Starting ad request. I/Ads (21352): SDK version: afma-sdk-a-v15090040.
每当我尝试运行该应用程序时,都会显示一个错误,并且来自 list 。下面是 list 和 logcat。请帮忙。 Manifest.xml
我可以在 AndroidManifest.xml 中设置一个设置,让我的应用程序写入文件系统而不仅仅是 SD 卡吗? *干杯 最佳答案 您应该使用定义的数据存储选项之一 here用于存储您的数据。要访
我按照一些教程使用 phonegap 的条形码扫描器插件。但是当我从现有源创建一个新的 android 项目来创建条码库时 (step 6 in this page)我收到错误:“AndroidMan
我的内存非常模糊,但是 Android SDK 中包含一个工具,当您针对未签名或调试签名的应用程序 APK(我不记得是哪个)运行它时,它会输出一个“已处理”的 AndroidManifest 文件。
是否可以在文件中指定一些信息,例如 API key ,然后以某种方式将此信息注入(inject) AndroidManifest 文件(可能在构建过程中)? 对于我的特定用例,documentatio
谁能解释一下是什么: tools:replace = "icon, label" 这之间有什么区别: tools:replace="android:icon,android:allowBackup,a
我正在尝试在嵌套 fragment 中显示 GoogleMaps: // inflate and return the layout View v = inflater.inflate
我正在发布针对中国市场的版本,我们都知道他们不支持 Playstore。从今以后,我们决定在中国商店发布。 其中一家中国商店要求在 list 文件中包含包名必须包含应用程序名称。但是现在我们的主 li
我是一名优秀的程序员,十分优秀!