我正在使用gamemaker studio 1,我刚刚添加了gameanalytics扩展,然后我开始在编译时遇到错误。
这是错误:
com.dragonpirates.trollforpubg:processReleaseManifestZ:\com.dragonpirates.trollforpubg\src\main\AndroidManifest.xml:60:1-114 Error:
Element meta-data#com.google.android.gms.version at AndroidManifest.xml:60:1-114 duplicated with element declared at AndroidManifest.xml:56:2-117
Z:\com.dragonpirates.trollforpubg\src\main\AndroidManifest.xml Error:
Validation failed, exiting
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
:com.dragonpirates.trollforpubg:processReleaseManifest FAILED
FAILURE: Build failed with an exception.
出了什么问题:
Execution failed for task ':com.dragonpirates.trollforpubg:processReleaseManifest'.
> Manifest merger failed with multiple errors, see logs
我的机器清单:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dragonpirates.trollforpubg" android:versionCode="1001007" android:versionName="1.1.7" android:installLocation="auto" xmlns:tools="http://schemas.android.com/tools" android:allowBackup="false">
<!-- This is the androidmanifest.xml used as the basis for building game .apk's from Studio -->
<!-- uses here -->
<uses-feature android:glEsVersion="0x00020000" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="com.android.vending.CHECK_LICENSE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<permission android:name="com.dragonpirates.trollforpubg.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.dragonpirates.trollforpubg.permission.C2D_MESSAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- <uses-feature android:glEsVersion="0x00020000" android:required="true" /> -->
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
<!-- <uses-sdk android:minSdkVersion="15" android:targetSdkVersion="25"/> -->
<supports-screens android:resizeable="true" android:largeScreens="true" />
<!-- application -->
<application android:name="com.dragonpirates.trollforpubg.RunnerApplication" android:label="@string/app_name" android:icon="@drawable/icon" tools:replace="android:label">
<activity android:name="com.dragonpirates.trollforpubg.RunnerActivity" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:label="@string/app_name" android:launchMode="singleTop" android:alwaysRetainTaskState="true" android:configChanges="orientation|keyboardHidden|screenSize" tools:replace="android:label">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.dragonpirates.trollforpubg.RunnerPreferenceActivity" android:label="@string/menu_settings"></activity>
<!-- services -->
<service android:name=".GcmIntentService" />
<meta-data android:name="com.google.android.gms.version" android:value="9683000" tools:replace="android:value" />
<activity android:name="com.google.android.gms.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />
<!-- activities here -->
<!-- receivers here -->
<receiver android:name=".GcmBroadcastReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.dragonpirates.trollforpubg" />
</intent-filter>
</receiver>
<receiver android:name=".PushLocalAlarmReceiver" />
<!-- This is XPeria Play specific, we have decided to make this standard though for all applications, just in case -->
<meta-data android:name="xperiaplayoptimized_content" android:resource="@string/xperiaplayoptimized_content" />
<meta-data android:name="game_display_name" android:resource="@string/app_name" />
<!-- <meta-data android:name="game_icon" android:resource="@drawable/icon" />
Removing due to following warning:
Resources referenced from the manifest cannot vary by configuration (except for version qualifiers, e.g. '-v21'.) Found variation in hdpi, ldpi, mdpi, xhdpi, xxhdpi, xxxhdpi
-->
<!-- meta-data here -->
<meta-data android:value="1" android:name="YYUse24Bit" />
<meta-data android:value="0" android:name="OrientLandscape" />
<meta-data android:value="-1" android:name="OrientPortrait" />
<meta-data android:value="0" android:name="OrientLandscapeFlipped" />
<meta-data android:value="0" android:name="OrientPortraitFlipped" />
<meta-data android:value="2" android:name="SplashscreenTime" />
<meta-data android:value="4" android:name="SleepMargin" />
<meta-data android:name="YYHostIP" android:value="127.0.0.1" />
<meta-data android:name="YYHostPort" android:value="51268" />
<meta-data android:name="YYNumExtensionClasses" android:value="4" />
<meta-data android:name="YYExtensionClass0" android:value="GooglePlayServicesExtension" />
<meta-data android:name="GoogleMobileAds_Banner" android:value="1" />
<meta-data android:name="GoogleMobileAds_MRect" android:value="2" />
<meta-data android:name="GoogleMobileAds_Full_Banner" android:value="3" />
<meta-data android:name="GoogleMobileAds_Leaderboard" android:value="4" />
<meta-data android:name="GoogleMobileAds_Skyscraper" android:value="5" />
<meta-data android:name="GooglePlayServices_SUCCESS" android:value="0" />
<meta-data android:name="GooglePlayServices_SERVICE_MISSING" android:value="1" />
<meta-data android:name="GooglePlayServices_SERVICE_UPDATING" android:value="18" />
<meta-data android:name="GooglePlayServices_SERVICE_VERSION_UPDATE_REQUIRED" android:value="2" />
<meta-data android:name="GooglePlayServices_SERVICE_DISABLED" android:value="3" />
<meta-data android:name="GooglePlayServices_SERVICE_INVALID" android:value="9" />
<meta-data android:name="YYExtensionClass1" android:value="GooglePlayLicensingAsExt" />
<meta-data android:name="YYExtensionClass3" android:value="GameAnalyticsExt" />
<meta-data android:name="GA_ERRORSEVERITY_DEBUG" android:value="1" />
<meta-data android:name="GA_ERRORSEVERITY_INFO" android:value="2" />
<meta-data android:name="GA_ERRORSEVERITY_WARNING" android:value="3" />
<meta-data android:name="GA_ERRORSEVERITY_ERROR" android:value="4" />
<meta-data android:name="GA_ERRORSEVERITY_CRITICAL" android:value="5" />
<meta-data android:name="GA_RESOURCEFLOWTYPE_SOURCE" android:value="1" />
<meta-data android:name="GA_RESOURCEFLOWTYPE_SINK" android:value="2" />
<meta-data android:name="GA_GENDER_MALE" android:value="1" />
<meta-data android:name="GA_GENDER_FEMALE" android:value="2" />
<meta-data android:name="GA_PROGRESSIONSTATUS_START" android:value="1" />
<meta-data android:name="GA_PROGRESSIONSTATUS_COMPLETE" android:value="2" />
<meta-data android:name="GA_PROGRESSIONSTATUS_FAIL" android:value="3" />
<meta-data android:value="true" android:name="EnablePushNotification" />
<meta-data android:value="pid1011672074512" android:name="PushNotificationID" />
<meta-data android:name="IsBuiltAsYoYoRunner" android:value="Yes" />
</application>
</manifest>
构建Gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '27.0.0'
defaultConfig {
applicationId "com.dragonpirates.trollforpubg"
minSdkVersion 15
targetSdkVersion 25
multiDexEnabled true
}
signingConfigs {
release {
storeFile file("C:/Users/mootaz/AppData/Local/GameMaker-Studio/trollforpubg.keystore")
storePassword "21313943"
keyAlias "alias"
keyPassword "21313943"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
signingConfig signingConfigs.release
}
}
splits {
abi {
enable true
reset()
include "armeabi-v7a"
universalApk false
}
}
}
dependencies {
compile 'com.android.support:support-v4:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/ini4j-0.5.2.jar')
compile 'com.google.android.gms:play-services-games:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services-plus:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile project(":library")
compile 'com.google.android.gms:play-services-base:10.2.1'
compile fileTree(dir: "elibs", include: ["*.jar"])
}
我试图解决这个问题已经好几天了,但我仍然没有找到任何解决方案! 在扩展文档中,它说我需要 Google Play Service 9.4.0 (我怎么知道我是否拥有它?我也无法在SDK管理器中找到它!
答案 0 :(得分:0)
尝试更改依赖项上的build.gradle文件:
compile 'com.google.android.gms:play-services-games:9.4.'
compile 'com.google.android.gms:play-services-ads:9.4.0'
compile 'com.google.android.gms:play-services-plus:9.4.0'
compile 'com.google.android.gms:play-services-gcm:9.4.0'
而不是
compile 'com.google.android.gms:play-services-games:9.6.1'
compile 'com.google.android.gms:play-services-ads:9.6.1'
compile 'com.google.android.gms:play-services-plus:9.6.1'
compile 'com.google.android.gms:play-services-gcm:9.6.1'
答案 1 :(得分:0)
我终于找到了解决方案! 第一个问题是有两个扩展(谷歌播放服务和游戏分析)具有相同的应用程序级别:
What is your name?
john
What is your surname?
smith
What is the date today?
12/12/2016
Write about an illness:
sick
#<Patient:0x007ffcb50ab518 @histories=[#
<Patient_history:0x007ffcb50aad98 @date="12/12/2016",
@description="sick">], @name="john", @surname="smith">
第二个问题gameanalytics使用谷歌播放服务10.5.0而不是9.4.0,你可以在gradle框中看到
<meta-data android:name="com.google.android.gms.version" android:value="9683000" tools:replace="android:value" />
1 - 从gameanalytics应用程序级别删除此行:
compile 'com.google.android.gms:play-services-base:10.5.0'
2-删除gradle Box中的每个写入并将其替换为此通道:
<meta-data android:name="com.google.android.gms.version" android:value="9683000" tools:replace="android:value" />
- 我将添加一些屏幕截图,以显示确切的位置。screen of gamenalytics extansion screen of google play services extension 希望你觉得这很有帮助!