ошибка: < /h2>
Launching lib\main.dart on Nokia G21 in debug mode...
Running Gradle task 'assembleDebug'... 21.6s
√ Built build\app\outputs\flutter-apk\app-debug.apk
Installing build\app\outputs\flutter-apk\app-debug.apk... 31.5s
E/AndroidRuntime(12164): FATAL EXCEPTION: main
E/AndroidRuntime(12164): Process: we.pos_ssas.pos_ssas, PID: 12164
E/AndroidRuntime(12164): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{we.pos_ssas.pos_ssas/android.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "android.MainActivity" on path: DexPathList[[zip file "/data/app/~~MgJW1GpbwRrVLEWAdxZq9g==/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/base.apk"],nativeLibraryDi
rectories=[/data/app/~~MgJW1GpbwRrVLEWAdxZq9g==/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/lib/arm64, /data/app/~~MgJW1GpbwRrVLEWAdxZq9g==/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(12164): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3589)
E/AndroidRuntime(12164): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3840)
E/AndroidRuntime(12164): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:105)
E/AndroidRuntime(12164): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:136)
E/AndroidRuntime(12164): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:96)
E/AndroidRuntime(12164): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2252)
E/AndroidRuntime(12164): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime(12164): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(12164): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(12164): at android.app.ActivityThread.main(ActivityThread.java:7941)
E/AndroidRuntime(12164): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(12164): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553)
E/AndroidRuntime(12164): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
E/AndroidRuntime(12164): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.MainActivity" on path: DexPathList[[zip file "/data/app/~~MgJW1GpbwRrVLEWAdxZq9g==
/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/base.apk"],nativeLibraryDirectories=[/data/app/~~MgJW1GpbwRrVLEWAdxZq9g==/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/lib/arm64, /data/app/~~MgJW1GpbwRrVLEWAdxZq9g==/we.pos_ssas.pos_ssas-yWLtXK2bVQAai1FY5c9YPg==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
E/AndroidRuntime(12164): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
E/AndroidRuntime(12164): at java.lang.ClassLoader.loadClass(ClassLoader.java:637)
E/AndroidRuntime(12164): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
E/AndroidRuntime(12164): at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:95)
E/AndroidRuntime(12164): at androidx.core.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:44)
E/AndroidRuntime(12164): at android.app.Instrumentation.newActivity(Instrumentation.java:1273)
E/AndroidRuntime(12164): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3575)
E/AndroidRuntime(12164): ... 12 more
< /code>
Я попытался предложить здесь многочисленные решения, но ни один из них не решил мою проблему. Ниже приведены некоторые файлы приложения; Возможно, вы сможете определить кое -что, что я пропустил. H2>
package we.pos_ssas.pos_ssas
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity()
функциональный
android/app/build.gradle:
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
android {
namespace = "we.pos_ssas.pos_ssas"
compileSdkVersion 34
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 // Set to Java 17
targetCompatibility JavaVersion.VERSION_1_8 // Set to Java 17
}
kotlinOptions {
jvmTarget = "1.8" // Use Java 1.8 or Java 17 for Kotlin JVM target
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/bu ... on-id.html).
applicationId = "we.pos_ssas.pos_ssas"
minSdk = flutter.minSdkVersion
targetSdkVersion 34
versionCode = flutter.versionCode
versionName = flutter.versionName
multiDexEnabled true //add multidex enabled
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.debug
}
}
sourceSets {
main {
java.srcDirs = ['./src/main/kotlin/']
}
}
}
flutter {
source = "../.."
}
android/build.gradle:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:8.2.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.20"
classpath 'androidx.multidex:multidex:2.0.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = "../build"
subprojects {
// Fix for verifyReleaseResources
afterEvaluate { project ->
if (project.plugins.hasPlugin("com.android.application") ||
project.plugins.hasPlugin("com.android.library")) {
project.android {
compileSdkVersion 34 // Compile SDK version
buildToolsVersion "34.0.0" // Build tools version
}
}
if (project.hasProperty("android")) {
project.android {
if (!project.hasProperty("namespace") || namespace == null) {
namespace = project.group.toString() // Dynamically set namespace
}
}
}
}
// Organize build directories
project.buildDir = "${rootProject.buildDir}/${project.name}"
// Ensure app module is evaluated first if it exists
if (project.name != "app") {
project.evaluationDependsOn(":app")
}
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... d-class-an
Как решить ошибку: java.lang.classnotfoundexception: не нашел класс "Android.mainactivity" на пути: dexpathlist ⇐ JAVA
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение