2017-08-30 2 views
10

Ich habe vor kurzem auf den Gradle-3.0.0-Alpha8 aktualisiert, nach dem einige Stile nicht zur Kompilierzeit aufgelöst werden.
entwickeln envirment:Fehler: Stilattribut '@android: attr/windowExitAnimation' nicht gefunden

  • IDE: Android Studio 3.0 Bate3
  • Gradle Werkzeuge bauen: 'com.android.tools.build:gradle:3.0.0-beta3'
  • Gradle: gradle-4.1- all.zip

Fehlerinfo:

Error:(94, 5) style attribute '@android:attr/windowExitAnimation' not found 
    Error:(94, 5) style attribute '@android:attr/windowEnterAnimation' not found 

Einstellung android.enableAapt2 false = grad Die Datei le.properties kann dieses Problem lösen.

Aber, Instant App brauchen android.enableAapt2 = true. Was würde ich tun?

+0

https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html –

+0

Können Sie versuchen, es mit Android Studio Beta 2? Weil Beta 3 Version wurde entfernt https://androidstudio.googleblog.com/2017/08/android-studio-30-beta-3-is-now.html (mit android.enableAapt2) –

+0

Ich fand ein ähnliches Problem in der Öffentlichkeit gemeldet Tracker https://issuetracker.google.com/issues/65036100 –

Antwort

37

Das ganze Problem wurde bereits gelöst.

Ursache des Problems:

Es gibt zwei Module, A_module, b_Module.

b_Module hat einen Stil:

<style name="my_style”> 
<item 
    name="@android:windowEnterAnimation">@anim/anim_toast_show</item> 
<item 
name="@android:windowExitAnimation">@anim/anim_toast_hide</item> 
</style> 

Wenn b_Module kompilieren (': A_module')
Erstellen oder Reinigen, berichten von einer Fehlerstelle in A_module-> Res-> Werte-> Stile:

Error:(94, 5) style attribute '@android:attr/windowExitAnimation' not found
Error:(94, 5) style attribute '@android:attr/windowEnterAnimation' not found

Lösung:
Entfernen des "@" am Anfang des Elementnamens.

<item name="@android:windowEnterAnimation">@anim/anim_toast_show</item> 
<item name="@android:windowExitAnimation">@anim/anim_toast_hide</item> 

zu:

<item name="android:windowEnterAnimation">@anim/anim_toast_show</item> 
<item name="android:windowExitAnimation">@anim/anim_toast_hide</item> 
+0

Ich hatte nicht mehrere Module, aber ich hatte das @ nicht bemerkt, das Entfernen funktionierte. danke – crgarridos

+0

aber wenn ich das modul_B nicht ändern kann, zum Beispiel kommt es von dritter Seite aar oder etwas, ich bekomme auch den gleichen Fehler auch, wie kann ich mit diesem Problem umgehen? – lightman1988

+0

Entfernen von @ aus Android Namespace dos nicht helfen @Martinzhangyu –