При создании APK я столкнулся со следующими двумя ошибками. ошибки. Между тем при сборке приложения Bundle произошла только одна ошибка. Вот подробности ошибок, с которыми я столкнулся: Ошибка APK:
Ошибка APK:
Код: Выделить всё
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/baka/Documents/Application/baka/myappku/build/app/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class org.tensorflow.lite.gpu.GpuDelegateFactory$Options$GpuBackend (referenced from: void org.tensorflow.lite.gpu.GpuDelegate.(org.tensorflow.lite.gpu.GpuDelegateFactory$Options))
Missing class org.tensorflow.lite.gpu.GpuDelegateFactory$Options (referenced from: void org.tensorflow.lite.gpu.GpuDelegate.() and 1 other context)
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':flutter_tflite:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR: /Users/baka/Documents/Application/baka/myappku/build/flutter_tflite/intermediates/merged_res/release/mergeReleaseResources/values/values.xml:194: AAPT: error: resource android:attr/lStar not found.
2: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete
Код: Выделить всё
ERROR: Missing classes detected while running R8. Please add the missing classes or apply additional keep rules that are generated in /Users/baka/Documents/Application/baka/myappku/build/app/outputs/mapping/release/missing_rules.txt.
ERROR: R8: Missing class org.tensorflow.lite.gpu.GpuDelegateFactory$Options$GpuBackend (referenced from: void org.tensorflow.lite.gpu.GpuDelegate.(org.tensorflow.lite.gpu.GpuDelegateFactory$Options))
Missing class org.tensorflow.lite.gpu.GpuDelegateFactory$Options (referenced from: void org.tensorflow.lite.gpu.GpuDelegate.() and 1 other context)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete
Код: Выделить всё
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"
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = rootProject.file('key.properties')
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
android {
namespace = "com.example.myappku"
compileSdk = flutter.compileSdkVersion
ndkVersion = "27.0.12077973"
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.myappku"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutter.versionCode
versionName = flutter.versionName
}
signingConfigs {
release {
keyAlias = keystoreProperties['keyAlias']
keyPassword = keystoreProperties['keyPassword']
storeFile = keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword = keystoreProperties['storePassword']
}
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile(
'proguard-android-optimize.txt'),
'proguard-rules.pro'
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig = signingConfigs.release
}
}
aaptOptions {
noCompress 'tflite'
noCompress 'lite'
}
}
flutter {
source = "../.."
}
Подробнее здесь: https://stackoverflow.com/questions/792 ... dio-vscode
Мобильная версия