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-pluginkotlin_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-stdlibkotlin_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