zu Android Studio Update auf mergedex mein Studio 3.0 Nach der Aktualisierung mich mit dem Problem begegnet:kann nicht nach 3.0
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#[email protected] value=(26.0.0) from [com.android.support:design:26.0.0]
AndroidManifest.xml:28:13-35 is also present at [com.android.support:appcompat-v7:26.1.0] AndroidManifest.xml:28:13-35 value=(26.1.0).
Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.
I indem Sie den folgenden Code, Problem gelöst:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support') {
if (!requested.name.startsWith("multidex")) {
details.useVersion '26.0.2'
}
}
}
}
aber nach der Einführung dieses Codes am Ende meiner build.gradle, zeigt es einen anderen Fehler, wenn ich versuche, meine Anwendung auf meinem Telefon zu starten:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Ich bezog mich auf viele Links mit ähnlichen Problemen, aber ich konnte die Lösung für mein Problem nicht finden.
Das ist mein build.gradle (Modul: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
multiDexEnabled true
applicationId "com.example.mahe.blooddonation"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
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'
})
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.google.android.gms:play-services:11.6.2'
implementation 'com.google.firebase:firebase-auth:11.6.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile files('libs/activation.jar')
compile files('libs/additionnal.jar')
compile files('libs/google-play-services.jar')
compile files('libs/http-core-4.1.jar')
compile files('libs/httpclient-4.0.3.jar')
compile files('libs/mail.jar') }
Mein build.gradle für das Projekt ist:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
maven{
url "https://github.com/omadahealth/omada-nexus/raw/master/release"
}
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Mein Manifest-Datei ist:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.mahe.blooddonation">
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<application
android:allowBackup="true"
android:icon="@mipmap/dexter"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".IntroScreen">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".SignUp" />
<activity android:name=".Login" />
<activity
android:name=".DonorOrReciever"
android:label="@string/title_activity_donor_or_reciever" />
<activity android:name=".RecieverActivity" />
<activity android:name=".ActivityProfile" />
<activity android:name=".EditProfile"></activity>
</application>
Und ich habe den Konfigurationsblock des Codes von meinem Gradle entfernt, und es kompiliert gut ohne es, aber ich stoße immer noch mit nicht zusammenführen dex.
meine komplette Stack Trace:
Error:java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Error:com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Ich hoffe, dass mir jemand helfen könnte.
diese Lösung versuchen und überprüfen Kommentare auch https://stackoverflow.com/questions/47607765/syncing-android-gradle-appcompat-27-0-1/47607794?noredirect=1#comment82175181_47607794 –
Kompilierung ‚com.android. Unterstützung: multidex: 1.0.1 'versuchen Sie diese Zeile in Ihrer App-Level-Gradle-Datei und ersetzen' Kompilieren 'durch' Implementierung ' –
einschließlich der' Implementierung 'Linie hat nicht funktioniert @mudit_sen Ich habe immer noch nicht in der Lage zu verbinden Dex kommen . –