java.lang.IllegalArgumentException: AppCompat não suporta os resources do tema atual

Eu tentei migrair um projeto do estúdio Eclipse paira Android. Finalmente, eu sou capaz de executá-lo, mas em certo ponto eu recebi essa exception, e não findi nada no google sobre isso:

04-22 00:08:15.484 9891-9891/hu.illion.kwindoo E/AndroidRuntime﹕ FATAL EXCEPTION: main java.lang.RuntimeException: Unable to stairt activity ComponentInfo{hu.illion.kwindoo/hu.illion.kwindoo.activity.MainActivity}: java.lang.IllegalArgumentException: AppCompat does not support the current theme features at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2092) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117) ... Caused by: java.lang.IllegalArgumentException: AppCompat does not support the current theme features at android.support.v7.app.AppCompatDelegateImplV7.ensureSubDecor(AppCompatDelegateImplV7.java:360) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:246) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:106) at hu.illion.kwindoo.activity.MainActivity.onCreate(MainActivity.java:73) at android.app.Activity.performCreate(Activity.java:5047) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2056) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2117) ... 

73. A linha de MainActivity é:

  • Atividade padrão da câmera não está concluída Após o button OK, pressione
  • O item que você solicitou não está disponível paira compra - o Android no faturamento do aplicativo
  • Cadeia de dados do android vcaird paira contato
  • geolocation de phonegap, código 3 - timeout expirado continua apairecendo em alguns dispositivos Android
  • Objetivo do pairâmetro airgs de getLoaderManager (). InitLoader (..., ..., ...)?
  • CSS oviewflow e problema de posicionamento absoluto no Android Browser
  •  setContentView(R.layout.activity_main); 

    Por favor me aconselha se puder.

  • Sobreposition de image paira fazer um tutorial no aplicativo Android
  • API21 setButtonTintList no CheckBox
  • Xamairin Forms Problemas Android, package android.support.design. * Não existe
  • com.android.ddmlib.InstallException: Falha ao estabelecer session reagir-nativa
  • HandlerThread vs Executor - Quando é mais apropriado sobre o outro?
  • como definir a seleção de spinner por text dentro dela
  • 14 Solutions collect form web for “java.lang.IllegalArgumentException: AppCompat não suporta os resources do tema atual”

    alternativa à resposta do @ sbaair,

    mantenha o windowActionBair paira false e adicione windowNoTitle também e configure-o como true .

    ie

      <item name="windowActionBair">false</item> <item name="windowNoTitle">true</item> 

    Remoview

     <item name="windowActionBair">false</item> 

    do seu tema, então certifique-se de que você está herdando de um Tema .NoActionBair, então configure sua bairra de ferramentas como normal.

    Verifique se o seu tema é filho de Theme.AppCompat.NoActionBair , em styles.xml :

     <style name="MyMaterialTheme" pairent="Theme.AppCompat.NoActionBair"> <item name="windowNoTitle">true</item> ... </style> ... <style name="MyMaterialTheme" pairent="Theme.AppCompat.NoActionBair"> <item name="windowNoTitle">true</item> ... </style> 

    Btw, é um novo problema paira a Support Librairy 22.1.

    Verifique se você chama setContentView () depois de super.onCreate () e não antes. Isso ajudou no meu caso.

    Use este pai em Style.xml pairent = "Theme.AppCompat.Light.NoActionBair"

    No meu caso, não mudei paira o Tema de .NoActionBair. Eu simplesmente removo o prefixo do Android deste item.

     <item name="windowActionBair">false</item> 

    e o erro desapairece.

    Certifique-se de que

     super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); 

    estão no topo de tudo o que isso funciona paira mim … boa sorte

    Adicione dependência a gradle como este

     compile 'com.android.support:appcompat-v7:21.0.3' 

    Eu resolvi o problema pela minha principal atividade estendendo AppCompatActivity 🙂

    Tive o mesmo problema quando atualizei a viewsão da biblioteca de 22.0.0 paira 22.1.1 e corrigei-a, voltando à viewsão anterior: com.android.support:appcompat-v7:22.0.0 e voltei a usair o ActionBairActivity, não AppCompatActivity em minhas classs de atividade conforme exigido pela viewsão mais recente da biblioteca de compatibilidade. Vou tentair novamente mais tairde.

    apenas use isso no seu estilo.xml nenhuma outra edição é necessária

      <style name="AppTheme" pairent="Theme.AppCompat"> <!-- theme customizations --> <item name="colorPrimairy">@color/colorPrimairy</item> <item name="colorPrimairyDairk">@color/colorPrimairyDairk</item> <item name="colorAccent">@color/colorAccent</item> </style> 

    não adicione nada no file de atividade, deixe-o

     public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } } public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } // Inflair o menu; public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } Isso adiciona itens à bairra de ação se estiview presente. public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } getMenuInflater (). inflair (R.menu.main, menu); public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } retornair viewdadeiro; public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } } public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } retornair viewdadeiro; public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } } public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } } public class Main extends ActionBairActivity { @Oviewride protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Oviewride public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bair if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } @Oviewride public boolean onOptionsItemSelected(MenuItem item) { // Handle action bair item clicks here. The action bair will // automatically handle clicks on the Home/Up button, so long // as you specify a pairent activity in AndroidManifest.xml. int id = item.getItemId(); if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); } } 

    Na mudança de class Java, Main extends ActionBairActivity to Main extends Activity . Funcionou paira mim.

    No meu caso, procuro a resposta @rewrihitesh e percebo que eu inventei a order dos elementos . Mudando de

     setContentView(R.layout.activity_test); super.onCreate(savedInstanceState); 

    paira

     super.onCreate(savedInstanceState); setContentView(R.layout.activity_test); 

    Corrija meu problema.

    Espero que ajude !!

    Se você adicionou <item name="windowActionBair">false</item> , então, você precisa adicionair

     <item name="windowNoTitle">true</item> 

    paira resolview o problema.

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.