tout d'abord, je suis nouveau sur Android, J'ai importé un projet Eclipse dans le studio Android. Sur le projet de construction, il montre cette erreur
"Erreur: L'exécution a échoué pour la tâche ': app: processDebugManifest'.> La fusion du manifeste a échoué avec plusieurs erreurs, voir les journaux"
mon code est comme suit,
AndroidManifest.xml
<?xml version="1.0" encoding="UTF-8"?>
<manifest xmlns:Android="http://schemas.Android.com/apk/res/Android" package="com.my.app" Android:versionCode="3" Android:versionName="1.2">
<supports-screens Android:resizeable="true" />
<supports-screens Android:smallScreens="true" />
<supports-screens Android:normalScreens="true" />
<supports-screens Android:largeScreens="true" />
<supports-screens Android:anyDensity="true" />
<!-- Permission - Internet Connect -->
<uses-permission Android:name="Android.permission.INTERNET" />
<!-- Network State Permissions -->
<uses-permission Android:name="Android.permission.ACCESS_NETWORK_STATE" />
<!-- Allows the API to access Google web-based services. -->
<uses-permission Android:name="com.google.Android.providers.gsf.permission.READ_GSERVICES" />
<!-- Allows the API to cache map tile data in the device's external storage area. -->
<uses-permission Android:name="Android.permission.WRITE_EXTERNAL_STORAGE" />
<!-- Keeps the processor from sleeping when a message is received. -->
<uses-permission Android:name="Android.permission.WAKE_LOCK" />
<uses-permission Android:name="Android.permission.VIBRATE" />
<uses-permission Android:name="Android.permission.CALL_PHONE" />
<uses-feature Android:glEsVersion="0x00020000" Android:required="true" />
<!--
Creates a custom permission so only this app can receive its messages.
NOTE: the permission *must* be called PACKAGE.permission.C2D_MESSAGE,
where PACKAGE is the application's package name.
-->
<permission Android:name="com.my.app.permission.C2D_MESSAGE" Android:protectionLevel="signature" />
<uses-permission Android:name="com.my.app.permission.C2D_MESSAGE" />
<!-- This app has permission to register and receive data message. -->
<uses-permission Android:name="com.google.Android.c2dm.permission.RECEIVE" />
<uses-permission Android:name="Android.permission.CALL_PHONE" />
<application Android:name="com.my.app.util.HotelApp" Android:allowBackup="true" Android:icon="@drawable/ic_launcher" Android:label="@string/app_name" Android:theme="@Android:style/Theme.Black.NoTitleBar">
<activity Android:name="com.my.app.activity.SplashActivity" Android:screenOrientation="portrait" Android:configChanges="orientation|keyboardHidden|screenSize" Android:theme="@Android:style/Theme.NoTitleBar.Fullscreen">
<intent-filter>
<action Android:name="Android.intent.action.MAIN" />
<category Android:name="Android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity Android:name="com.my.app.activity.HomeActivity" Android:theme="@Android:style/Theme.NoTitleBar.Fullscreen" Android:screenOrientation="portrait" Android:configChanges="orientation|keyboardHidden|screenSize" />
<activity Android:name="com.my.app.activity.CategoryActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.ContactUSActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.LeisuresActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.LeisureActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.PromosActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.ReservationActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.AboutUsActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.ReservationContinueActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.BookTableActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.AccommodationsActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.CorporatesActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.GuestServicesActivity" Android:screenOrientation="portrait" />
<activity Android:name="com.my.app.activity.PhotoGalleryActivity" Android:theme="@Android:style/Theme.Black.NoTitleBar.Fullscreen" Android:screenOrientation="portrait" Android:configChanges="orientation|keyboardHidden|screenSize" />
<activity Android:name="net.hockeyapp.Android.UpdateActivity" Android:screenOrientation="portrait" />
<!--<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="AIzaSyDAk_PM9Ce-z_9onkItz4aSahE1AGSBKDo" />-->
<!--
BroadcastReceiver that will receive intents from GCM
services and handle them to the custom IntentService.
The com.google.Android.c2dm.permission.SEND permission is necessary
so only GCM services can send data messages for the app.
-->
<receiver Android:name="com.google.Android.gcm.GCMBroadcastReceiver" Android:permission="com.google.Android.c2dm.permission.SEND">
<intent-filter>
<!-- Receives the actual messages. -->
<action Android:name="com.google.Android.c2dm.intent.RECEIVE" />
<!-- Receives the registration id. -->
<action Android:name="com.google.Android.c2dm.intent.REGISTRATION" />
<category Android:name="com.my.app" />
</intent-filter>
</receiver>
<!--
Application-specific subclass of GCMBaseIntentService that will
handle received messages.
By default, it must be named .GCMIntentService, unless the
application uses a custom BroadcastReceiver that redefines its name.
-->
<service Android:name=".GCMIntentService" />
</application>
</manifest>
et pour build.gradle comme suit
Android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "com.stgeorge.hotel"
minSdkVersion 8
targetSdkVersion 19
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-Android.txt'), 'proguard-rules.txt'
}
}
}
j'ai essayé d'autres solutions fournies ici sur le débordement de pile mais aucune n'a fonctionné
Supprimez la configuration sdk du fichier manifeste. Dans Android Studio, vous devez définir uniquement dans build.gradle
et changez également compileSdkVersion et buildToolVersion en sdk ciblé ou remplacez votre sdk cible par 23
Remarque: - compileSdkVersion et buildToolVersion doivent appartenir au même niveau d'API
J'ai résolu ce problème en supprimant simplement le filtre vide/inutilisé intent à l'intérieur d'une balise d'activité dans le manifeste.