ActivityMainBinding will einfach nicht

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

15.04.2023, 20:23:00 via Website

Hallo zusammen

Ich habe ein Kotlin Projekt welches einfach nicht mehr vorwärts kommt. Mit der neusten Kotlin Version muss man die Verbindung zur Activity umstellen. Bei allen anderen Projekten ging das ohne Probleme nur eines Bockt.

private lateinit var binding : ActivityMainBinding

Oben stehender Eintrag ergibt nur Fehler. "ViewBinding" hingegen funktioniert. Kennt jemand dieses Problem und kann mir sagen was ich wo ändern muss damit das Projekt wieder Läuft?

Gruss Renato

Kommentieren
Beste Antwort
Robbiani Renato
  • Forum-Beiträge: 609

22.04.2023, 15:18:06 via Website

Ich habe das Problem gefunden die folgende Zeile hat sich im Layout eingeschlichen:

tools:viewBindingIgnore="false"

Die Stand auf "true". Sobald ich es auf "false" stelle geht es wieder.

Danke allen die mitgeholfen haben eine Lösung zu finden.

Gruss Renato

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

15.04.2023, 22:10:58 via Website

Hallo zusammen

Weitere Informationen zu meinem Projekt.
Build.Gradle(Projekt)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.8.20'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Wenn ich die Zeile "google()" entferne, dann kann er "AppCompatActivity" nicht mehr importieren. Der Eintrag wird rot unterlegt.
Ich habe ein neues Projekt mit derselben Konfiguration angelegt. Dies enthält die Zeile "google()" nicht. In diesem Projekt funktioniert der Import von "AppCompatActivity" so wie auch folgende Zeile

private lateinit var binding : ActivityMainBinding

Weiss Jemand wo ich den Unterschied suchen muss?

Gruss Renato

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

16.04.2023, 11:06:11 via Website

Frage wie heist den deine Layout datei?
heist sie auch "activity_main.xml"

damit daus auch eine Klasse "ActivityMainBinding" erstellt wird.

aus "hallo_layout.xml" wird "HalloLayoutBinding"

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

16.04.2023, 11:12:37 via Website

zeige mal das komplette Gradel File (beide) und gradle-wrapper.properties , settings.gradle

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

16.04.2023, 18:01:09 via Website

Ciao Jokel

Herzlichen Dank, dass du dir die Mühe nimmst.

Zuerst die Dateien vom Projekt welches nicht funktioniert:
In diesem Projekt habe ich zwei "activity_main.xml". Eines für port und eines für land. Aber dies sollte doch kein Problem darstellen.
Gradle(project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.8.20'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Gradle(modul)

//apply plugin: 'com.android.application'

//apply plugin: 'kotlin-android'
//apply plugin: 'kotlin-android-extensions'
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
}

android {
compileSdkVersion 33
buildToolsVersion "30.0.3"

buildFeatures {
    viewBinding = true
}

defaultConfig {
    applicationId "ch.robbisoft.kassieren"
    minSdkVersion 21
    targetSdkVersion 33
    versionCode 9
    versionName '1.3.4'

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
namespace 'ch.robbisoft.kassieren'

}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
// implementation 'androidx.core:core-ktx:1.10.0'
// implementation 'androidx.appcompat:appcompat:1.6.1'
// implementation 'com.google.android.material:material:1.8.0'
// implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
// testImplementation 'junit:junit:4.13.2'
// androidTestImplementation 'androidx.test.ext:junit:1.1.5'
// androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

Gradle-wrapper.properties

#Sat Oct 31 12:50:36 CET 2020

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-all.zip

und vom Projekt wo es funktioniert:
Gradle(project)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

plugins {
id 'com.android.application' version '7.4.2' apply false
id 'com.android.library' version '7.4.2' apply false
id 'org.jetbrains.kotlin.android' version '1.8.0' apply false

}

allprojects {
repositories {
// google()
}
}

Gradle(modul)

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'

}

android {
namespace 'ch.robbisoft.kassieren'
compileSdk 33

buildFeatures {
    viewBinding = true
}

defaultConfig {
    applicationId "ch.robbisoft.kassieren"
    minSdk 21
    targetSdk 33
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
    jvmTarget = '1.8'
}

}

dependencies {
// implementation 'com.android.support.constraint:constraint-layout:2.0.4'
// testImplementation 'junit:junit:4.13.2'
// androidTestImplementation 'com.android.support.test:runner:1.0.2'
// androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.8.20"
implementation 'androidx.core:core-ktx:1.10.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

gradle-wrapper.properties

#Sat Apr 15 21:05:45 CEST 2023

distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

Gruss Renato

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

16.04.2023, 19:55:12 via Website

Schaue dir doch mal an wie die "settings.gradle" Datei bei den laufenden Projekt ausschaut.

Deine Projekt Strukture solltest du auch richtig einstellen.

imageimageimage

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

17.04.2023, 21:50:38 via Website

Ciao Jokel

Danke für die Hilfe.
Geholfen hat es nicht. Dafür habe ich etwas neues im Projekt.

image

Was soll ich mit dieser Meldung? Es hat kein Link um etwas zu unternehmen.
Vielleicht hast du Rat.

Gruss Renato

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

18.04.2023, 05:40:53 via Website

Das ist das was ich schon in post 1 gesagt habe. Hast du überhaupt das Viewbinding im Gradle eingeschaltet?
Und heißt deine layoutdatei auch so damit darsus auch genau diese Klasse automatisch erstellt wird. Mit genau den Bezeichner.

Ist das Layout auch fehlerfrei. Damit es auch übersetzt werden kann und somit auch die Klasse erstellt werden kann.
Wenn in dem xml was rot ist. Wird es nicht gehen.

Mache auch mal ein rebuild und clear.

— geändert am 18.04.2023, 05:48:39

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

20.04.2023, 21:20:14 via Website

Ciao Jokel

Danke für deine Hinweise. Ja habe ich alles schon versucht.
Wie ich bereits gesagt habe, habe ich für das activity_main zwei Dateien. In keinem ist was rot. Aber in einem kommt der folgende Fehler :

edt_zahlen <EditText>: Touch target size too small

und oben rechts steht eine rote eins. Ich weiss nicht was dieser Fehler bedeutet und im Internet finde ich auch nichts.
Vielleicht kannst du mir da weiter helfen?

Gruss Renato

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

22.04.2023, 12:27:57 via Website

Ciao Jokel

Ich habe im Layout beim Editfeld habe ich "minWidth" und "minHeight" gesetzt. Nun ist der Fehler weg aber es geht immer noch nicht.

<EditText
                android:id="@+id/edt_zahlen"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:ems="10"
                android:minWidth="48dp"
                android:minHeight="48dp"
                android:hint="@string/lbl_zahl"
                android:inputType="numberDecimal" />

Das Layout "port"

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

xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/lay_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:viewBindingIgnore="true"
tools:context=".MainActivity" >

<ScrollView
    android:id="@+id/scr_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/lay_top"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical" >

        <LinearLayout
            android:id="@+id/lay_eins"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_null"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="^" />

            <Button
                android:id="@+id/btn_eins"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="1" />

            <Button
                android:id="@+id/btn_zwei"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="2" />

            <Button
                android:id="@+id/btn_drei"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="3" />

            <Button
                android:id="@+id/btn_vier"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="4" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_zwei"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_fuenf"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="5" />

            <Button
                android:id="@+id/btn_sechs"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="6" />

            <Button
                android:id="@+id/btn_sieben"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="7" />

            <Button
                android:id="@+id/btn_acht"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="8" />

            <Button
                android:id="@+id/btn_neun"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="9" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_drei"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_zehn"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="10" />

            <Button
                android:id="@+id/btn_zwanzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="20" />

            <Button
                android:id="@+id/btn_dreisig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="30" />

            <Button
                android:id="@+id/btn_vierzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="40" />

            <Button
                android:id="@+id/btn_fuenfzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="50" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_vier"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_sechzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="60" />

            <Button
                android:id="@+id/btn_siebzieg"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="70" />

            <Button
                android:id="@+id/btn_achzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="80" />

            <Button
                android:id="@+id/btn_neunzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="90" />

            <Button
                android:id="@+id/btn_hundert"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="100" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_rp_eins"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_rp_fuenf"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".05" />

            <Button
                android:id="@+id/btn_rp_zehn"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".10" />

            <Button
                android:id="@+id/btn_rp_fuenfzehn"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".15" />

            <Button
                android:id="@+id/btn_rp_zwanzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".20" />

            <Button
                android:id="@+id/btn_rp_fuenfzwanzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".25" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_rp_zwei"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_rp_dreisig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".30" />

            <Button
                android:id="@+id/btn_rp_fuenfdreisig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".35" />

            <Button
                android:id="@+id/btn_rp_vierzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".40" />

            <Button
                android:id="@+id/btn_rp_fuenffierzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".45" />

            <Button
                android:id="@+id/btn_rp_fuenfzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".50" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_rp_drei"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_rp_fuenffuenfzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".55" />

            <Button
                android:id="@+id/btn_rp_sechzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".60" />

            <Button
                android:id="@+id/btn_rp_fuenfsechzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".65" />

            <Button
                android:id="@+id/btn_rp_siebzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".70" />

            <Button
                android:id="@+id/btn_rp_fuenfsiebzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".75" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_rp_vier"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <Button
                android:id="@+id/btn_delete"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/lbl_grosser" />

            <Button
                android:id="@+id/btn_rp_achzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".80" />

            <Button
                android:id="@+id/btn_rp_fuenfachzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".85" />

            <Button
                android:id="@+id/btn_rp_neunzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".90" />

            <Button
                android:id="@+id/btn_rp_fuenfneunzig"
                style="@style/button"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text=".95" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_preis"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/lbl_preis"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight="5"
                android:text="@string/lbl_preis_text" />

            <TextView
                android:id="@+id/txt_preis"
                style="@style/label"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical"
                android:layout_weight="20"
                android:hint="@string/lbl_preis_text" />

            <ImageButton
                android:id="@+id/btn_plus"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background=""
                app:srcCompat="@drawable/button_plus_klein"
                android:contentDescription="TODO" />

            <ImageButton
                android:id="@+id/btn_minus"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background=""
                app:srcCompat="@drawable/button_minus_klein"
                android:contentDescription="TODO" />
        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_summe"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/lbl_summe"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="@string/lbl_summe_text" />

            <TextView
                android:id="@+id/txt_summe"
                style="@style/label"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:hint="@string/lbl_summe_text" />

            <EditText
                android:id="@+id/edt_zahlen"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:ems="10"
                android:minWidth="48dp"
                android:minHeight="48dp"
                android:hint="@string/lbl_zahl"
                android:inputType="numberDecimal" />

        </LinearLayout>

        <LinearLayout
            android:id="@+id/lay_back"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/edt_back"
                style="@style/label"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:hint="@string/lbl_back" />

            <Button
                android:id="@+id/btn_loschen"
                style="@style/kassebutton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/button_lang_blau"
                android:text="@string/lbl_losch" />

            <Button
                android:id="@+id/btn_zahlen"
                style="@style/kassebutton"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:background="@drawable/button_lang_blau"
                android:text="@string/lbl_bezahl" />
        </LinearLayout>
    </LinearLayout>
</ScrollView>

Gruss Renato

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

22.04.2023, 12:43:18 via Website

Das Problem liegt bei dem activity_main Layout. Ich habe ein neues Projekt angelegt. Das läuft ohne Probleme. Sobald ich die Layouts vom Problemprojekt rüber kopiere, funktioniert die "activityMainbinding" nicht mehr.

Die gute Frage ist, wo liegt das Problem?
Hat es eine Möglichkeit das Layout zu prüfen.

Gruss Renato

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

22.04.2023, 15:18:06 via Website

Ich habe das Problem gefunden die folgende Zeile hat sich im Layout eingeschlichen:

tools:viewBindingIgnore="false"

Die Stand auf "true". Sobald ich es auf "false" stelle geht es wieder.

Danke allen die mitgeholfen haben eine Lösung zu finden.

Gruss Renato

Hilfreich?
Kommentieren