App Stürzt ab

  • Antworten:10
  • Bentwortet
Robbiani Renato
  • Forum-Beiträge: 609

20.01.2019, 11:31:55 via Website

Hallo zusammen

Meine App Startet nicht mehr und ich kann den Fehler nicht finden. Vielleicht weiss jemand wo der Fehler zu suchen ist.

01-20 11:18:15.197 18632-18632/ch.robbisoft.sakristanhilfe E/AndroidRuntime: FATAL EXCEPTION: main
Process: ch.robbisoft.sakristanhilfe, PID: 18632
java.lang.RuntimeException: Unable to start activity ComponentInfo{ch.robbisoft.sakristanhilfe/ch.robbisoft.sakristanhilfe.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2689)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2754)
    at android.app.ActivityThread.access$900(ActivityThread.java:177)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:145)
    at android.app.ActivityThread.main(ActivityThread.java:5938)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
 Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
    at android.support.v7.app.AppCompatDelegateImplV9.createSubDecor(AppCompatDelegateImplV9.java:354)
    at android.support.v7.app.AppCompatDelegateImplV9.ensureSubDecor(AppCompatDelegateImplV9.java:323)
    at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:284)
    at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
    at ch.robbisoft.sakristanhilfe.MainActivity.onCreate(MainActivity.java:17)
    at android.app.Activity.performCreate(Activity.java:6288)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2642)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2754) 
    at android.app.ActivityThread.access$900(ActivityThread.java:177) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448) 
    at android.os.Handler.dispatchMessage(Handler.java:102) 
    at android.os.Looper.loop(Looper.java:145) 
    at android.app.ActivityThread.main(ActivityThread.java:5938) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:372) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195) 

So viel wie ich verstehe kann die Komponente "ComponentInfo" nicht starten. Aber eine solche Komponente habe ich nicht. Oder wo muss ich die suchen?

Gruss Renato

Kommentieren
Beste Antwort
Jokel
  • Forum-Beiträge: 1.530

21.01.2019, 18:56:25 via Website

lese bitte alles in dem Beitrag.

35 You can remove the warning by adding xmlns:tools="http://schemas.android.com/tools" to the tag and tools:ignore="GoogleAppIndexingWarning" to the tag.

füge die Zeile (tools:ignore="GoogleAppIndexingWarning")
in dein Manifest bei application hinzu.

<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"
        tools:ignore="GoogleAppIndexingWarning">
    <activity android:name=".MainActivity">

— geändert am 21.01.2019, 18:58:59

Hilfreich?
Robbiani Renato
Kommentieren
Jokel
  • Forum-Beiträge: 1.530

20.01.2019, 11:52:51 via Website

Hallo

IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity

mit deinem Theme scheit etwas nicht zu stimmen.

was hast du als letztes verändert?

prüfe dein Layout und deine Manifest.

Stimmen deine dependencies ?

— geändert am 20.01.2019, 11:59:51

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 609

20.01.2019, 12:03:36 via Website

Cioa Jokel

Im Manifest habe ich folgende Warnung:

App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent filter. See issue explanation for more details. less... (Strg+F1) 

Inspection info:Adds URLs to get your app into the Google index, to get installs and traffic to your app from Google Search.

Aber das Manifest sieht nicht anders aus, als bei allen anderen Apps welche klaglos laufen.

Gruss Renato

Hilfreich?
Kommentieren
Pascal P.
  • Admin
  • Forum-Beiträge: 11.286

20.01.2019, 12:09:24 via Website

Die Frage ist ob du in deiner ch.robbisoft.sakristanhilfe.MainActivity im Mainfest die Theme gesetzt hast.
Eventuell musst du dies explizit tun.

LG Pascal //It's not a bug, it's a feature. :) ;)

Hilfreich?
Kommentieren
Jokel
  • Forum-Beiträge: 1.530

20.01.2019, 12:10:08 via Website

deine Activity scheint wohl nicht im manifest eingetragen zu sein.
zeige mal das Manifest.

Und wie heißt deine Activity die gestartet werden soll.

— geändert am 20.01.2019, 12:10:26

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 609

20.01.2019, 18:05:28 via Website

Ciao Jokel

Danke, dass du dir Zeit für mich nimmst. Ich komme nicht mehr weiter. Sieht so aus wie bei allen bisherigen Projekten. Trotzdem geht es nicht.

Manifest:

<?xml version="1.0" encoding="utf-8"?>

package="ch.robbisoft.sakristanhilfe">

<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="@android:style/Theme.NoTitleBar.Fullscreen">
    <activity android:name=".MainActivity" android:screenOrientation="portrait">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
</application>

Activitiy:

package ch.robbisoft.sakristanhilfe;

import android.speech.tts.TextToSpeech;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity{

private Button btn_eingabe;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    btn_eingabe = findViewById(R.id.btn_eingabe);

// btn_eingabe.setOnClickListener();
}
}

Ich mache nicht mehr lange. Dann lösche ich das Projekt und beginne nochmals von vorne.

Gruss Renato

Hilfreich?
Kommentieren
Jokel
  • Forum-Beiträge: 1.530

20.01.2019, 18:44:34 via Website

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

Wird wohl nicht vorhanden sein.
Lasse es im manifest lieber bei der Standard Zeile.

android:theme="@style/AppTheme"

Ändere lieber das Theme in der styles.xml Datei.
Zb so

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="android:windowFullscreen">true</item>
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>
Hilfreich?
Robbiani Renato
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 609

20.01.2019, 19:01:49 via Website

Danke Jokel

So geht es. Aber die Warnung bleibt immer noch stehen. Mal schauen was ich machen werde.

Gruss Renato

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 609

21.01.2019, 18:13:08 via Website

Ciao Jokel

Danke für den Link. Diesen habe ich auch schon gesehen. Kann aber mit der Antwort nichts anfangen. Ich verstehe nicht was man da machen soll.

Gruss Renato

Hilfreich?
Kommentieren
Beste Antwort
Jokel
  • Forum-Beiträge: 1.530

21.01.2019, 18:56:25 via Website

lese bitte alles in dem Beitrag.

35 You can remove the warning by adding xmlns:tools="http://schemas.android.com/tools" to the tag and tools:ignore="GoogleAppIndexingWarning" to the tag.

füge die Zeile (tools:ignore="GoogleAppIndexingWarning")
in dein Manifest bei application hinzu.

<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"
        tools:ignore="GoogleAppIndexingWarning">
    <activity android:name=".MainActivity">

— geändert am 21.01.2019, 18:58:59

Hilfreich?
Robbiani Renato
Kommentieren