Ungelöste Referenz: IO, ungelöste Referenz: FlatternaktivitätAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 Ungelöste Referenz: IO, ungelöste Referenz: Flatternaktivität

Post by Anonymous »

ungelöste Referenz: IO und ungelöste Referenz: Flatternaktivitätsfehler beim Versuch, apk zu flattern.

Code: Select all

e: file:///C:/flutterprojects/apkteerkhelo99/android/app/src/main/kotlin/com/example/teerkhelo99/MainActivity.kt:5:8 Unresolved reference: io
e: file:///C:/flutterprojects/apkteerkhelo99/android/app/src/main/kotlin/com/example/teerkhelo99/MainActivity.kt:7:22 Unresolved reference: FlutterActivity

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
> Compilation error.  See log for more details
Android\Build.gradle[/b]

Code: Select all

buildscript {
ext.kotlin_version = '1.9.20'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:8.6.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.15'
}
}

allprojects {
repositories {
google()
mavenCentral()
maven {
url 'https://storage.googleapis.com/download.flutter.io'
}
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Android/app/build.gradle

Code: Select all

plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "dev.flutter.flutter-gradle-plugin"
id "com.google.gms.google-services"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode', '1').toInteger()
def flutterVersionName = localProperties.getProperty('flutter.versionName', '1.0')

android {
namespace "com.example.teerkhelo99"
compileSdkVersion 34
ndkVersion "25.1.8937393"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = '1.8'
}

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

defaultConfig {
applicationId "com.example.teerkhelo99"
minSdkVersion 21
targetSdkVersion 34
versionCode flutterVersionCode
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

externalNativeBuild {
cmake {
version "3.22.1"
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation platform("com.google.firebase:firebase-bom:32.7.0")
implementation "com.google.firebase:firebase-analytics"
implementation "com.google.firebase:firebase-auth"
implementation "androidx.multidex:multidex:2.0.1"
implementation "androidx.core:core-ktx:1.9.0"
implementation "androidx.appcompat:appcompat:1.6.1"
implementation "com.google.android.material:material:1.11.0"
}
Android/app/src/main/kotlin/com/example/teerkhelo99/mainActivity.kt

Code: Select all

package com.example.teerkhelo99

import io.flutter.embedding.android.FlutterActivity

class MainActivity :  FlutterActivity() {
}
Local.properties

Code: Select all

flutter.sdk=C:\\src\\flutter
sdk.dir=C:\\Android\\Sdk
flutter.buildMode=release
flutter.versionName=1.0.0
flutter.versionCode=1
android.buildToolsVersion=35.0.1
settings.gradle

Code: Select all

pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")

repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

plugins {
id 'com.android.application' version '8.6.0' apply false
id 'org.jetbrains.kotlin.android' version '1.9.22' apply false
id 'com.google.gms.google-services' version '4.4.0' apply false
id 'dev.flutter.flutter-gradle-plugin' apply false
}

include ":app"

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post