Что касается заголовка выше, я создал приложение через Android Studio.
Приложение может работать в эмуляторе Android Studio, но не может быть запущено при установке на microC.
Это build.gradle для приложения:
Код: Выделить всё
plugins {
id 'com.android.application'
// id 'org.jetbrains.kotlin.android'
id 'maven-publish'
}
android {
namespace 'com.example.nfcnpn532'
compileSdk 33
defaultConfig {
applicationId "com.example.nfcpn532"
minSdk 28
targetSdk 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
debug {
// Optionally enable minification for debug builds to test R8 optimizations
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'
}*/
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.3.2'
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
sourceSets {
main{
jniLibs.srcDirs = ['src/main/jniLibs'] // Point to the jniLibs folder
}
}
defaultConfig {
externalNativeBuild {
cmake {
cppFlags ""
}
}
ndk {
abiFilters "armeabi-v7a", "arm64-v8a", "x86_64", "x86"
}
}
externalNativeBuild {
cmake {
path "src/main/cpp/CMakeLists.txt"
}
}
externalNativeBuild {
cmake {
version "3.30.5"
}
}
ndkVersion '25.1.8937393'
}
dependencies {
implementation "androidx.annotation:annotation:1.6.0"
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:1.10.19'
androidTestImplementation 'androidx.test:core:1.5.0'
androidTestImplementation 'androidx.test:runner:1.5.2'
androidTestImplementation 'commons-net:commons-net:3.8.0'
androidTestImplementation 'org.apache.commons:commons-lang3:3.11'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.github.mik3y:usb-serial-for-android:3.5.1'
implementation 'androidx.core:core:1.10.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation "androidx.compose.ui:ui:1.4.3"
implementation "androidx.compose.material3:material3:1.1.1"
implementation "androidx.compose.foundation:foundation:1.4.3"
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.errorprone:error_prone_annotations:2.3.4'
// Error-prone annotations for compile-time
compileOnly 'com.google.errorprone:error_prone_annotations:2.3.4'
// javax.annotation library
compileOnly 'javax.annotation:javax.annotation-api:1.3.2'
constraints {
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.0") {
because("kotlin-stdlib-jdk7 is now a part of kotlin-stdlib")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.0") {
because("kotlin-stdlib-jdk8 is now a part of kotlin-stdlib")
}
}
}
Код: Выделить всё
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
// jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
// classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.30"
classpath 'com.android.tools.build:gradle:8.0.2'
classpath 'com.github.dcendents:android-maven-plugin:1.2'
// classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
}
}
запустив logcat adb, я могу определить, что «WindowManager: невозможно запустить анимацию, поверхность равна нулю или нет дочерних элементов»
как могу ли я это исправить?
Подробнее здесь: https://stackoverflow.com/questions/791 ... t-cant-run
Мобильная версия