我對Android Studio完全陌生,因此對於有經驗的人來說聽起來可能很愚蠢。Android Studio錯誤:任務':app:processDebugManifest'的執行失敗'
我越來越Android Studio中的錯誤,指出:
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#[email protected]
value=(25.3.1) from [com.android.support:design:25.3.1]
AndroidManifest.xml:27:9-31
is also present at [com.android.support:appcompat-v7:26.0.0-alpha1]
AndroidManifest.xml:27:9-38 value=(26.0.0-alpha1).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at
AndroidManifest.xml:25:5-27:34 to override.
我用Google搜索這一點,並試圖尋找到它,解決它在我自己的,但是,我也發現了類似的問題也不盡相同的錯誤。
我沒有足夠的經驗來理解和生成一個修復程序,雖然我理解它的一些。
可能是這種情況,我需要提供更多的信息,所以請讓我知道如果是這樣。
EDIT:
的AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.g732d.appname"
>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".HomeActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Patients" />
<activity android:name=".NewPatient" />
<activity android:name=".StartActivity"></activity>
</application>
</manifest>
的build.gradle(項目:應用程序名稱):
// Top-level build file where you can add configuration options common to
all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
// NOTE: Do not place your application dependencies here; they
belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
的build.gradle(模塊: App):
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "26.0.0"
defaultConfig {
applicationId "com.g732d.appname"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.1'
}
第二個編輯:
繼Arefeh答案,並通過注:Kunal的評論,我用compile 'com.android.support:design:26.0.0-beta2'
更換compile 'com.android.support:design:25.3.1'
改變的版本不匹配。
爲了達到這個目的,我必須在build.gradle (Project: appname)
文件allprojects{}
(上面已更新以說明這一點)中添加maven { url "https://maven.google.com" }
。
現在我不斷收到一個渲染錯誤,說failed to instantiate one or more classes
。根據我在活動中使用的內容,每個活動的類別不同,例如
The following classes could not be instantiated:
- android.support.v7.widget.AppCompatImageView
...
...
發佈您的'清單'和'build.gradle' – dustblue
感謝dustblue,我剛剛通過編輯的方式添加它們。 – Gazza732
請添加另一個gradle文件。 'build.gradle(Module:app)' –