Невозможно разрешить супертипы следующих классов: приложение Android не может быть запущеноAndroid

Форум для тех, кто программирует под Android
Ответить Пред. темаСлед. тема
Anonymous
 Невозможно разрешить супертипы следующих классов: приложение Android не может быть запущено

Сообщение Anonymous »

Когда я попытался запустить приложение, появились следующие ошибки:

Код: Выделить всё

> Task :app:compileDebugKotlin FAILED
e: Supertypes of the following classes cannot be resolved.  Please make sure you have the required dependencies in the classpath:
class android.view.animation.LinearInterpolator, unresolved supertypes: android.graphics.animation.NativeInterpolator
class android.view.animation.AccelerateDecelerateInterpolator, unresolved supertypes: android.graphics.animation.NativeInterpolator
Adding -Xextended-compiler-checks argument might provide additional information.
build.gradle:app

Код: Выделить всё

plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id "jacoco"
}
jacoco {
toolVersion("0.8.11")
}
apply from: "$project.rootDir/jacoco.gradle"

//this for getting version name from ChangeLog.md file

def getVersionName() {
File file = file('../ChangeLog.md')
return file.readLines().get(0)
}
//this for getting version code from ChangeLog.md file
def getVersionCode() {
File file = file('../ChangeLog.md')
return file.readLines().get(1)
}

def versionNameInQuotes = getVersionName()
def versionCodeNumber = getVersionCode() as Integer

android {
namespace 'com.example.testapp'
compileSdk 32

defaultConfig {
applicationId "com.example.testapp"
minSdk 31
targetSdk 32
versionCode versionCodeNumber
versionName "$versionNameInQuotes"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
archivesBaseName = "TestApp"
}

buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}

buildFeatures {
viewBinding true
}

dataBinding {
enabled = true
}

kotlinOptions {
jvmTarget = '11'
// allWarningsAsErrors = true
}

packagingOptions {
resources {
excludes += ['META-INF/INDEX.LIST', 'META-INF/io.netty.versions.properties']
}
}
testOptions {
unitTests.returnDefaultValues = true
unitTests.includeAndroidResources = true
}
}

dependencies {

implementation fileTree(include: ['*.aar'], dir: 'libs')
implementation project(path:  ':testservice')

implementation Dependencies.core_ktx
implementation Dependencies.appcompat
implementation Dependencies.material
implementation Dependencies.constraintlayout
implementation Dependencies.livedata_ktx
implementation Dependencies.view_model_ktx
testImplementation Dependencies.test_junit
androidTestImplementation Dependencies.ext_junit
androidTestImplementation Dependencies.espresso_core

//Hilt
implementation(Dependencies.hilt_android)
kapt(Dependencies.hilt_compiler)

//Gson converter
implementation(Dependencies.gson_retrofit_converter)

//Mockito
testImplementation(Dependencies.mockito_core)
testImplementation(Dependencies.mockito_kotlin)

androidTestImplementation(Dependencies.mockito_core)
androidTestImplementation(Dependencies.mockito_kotlin)
androidTestImplementation Dependencies.mockito_android

//core testing
testImplementation Dependencies.core_testing

// Hilt testing dependency
androidTestImplementation Dependencies.hilt_android_testing
// Make Hilt generate code in the androidTest folder
kaptAndroidTest Dependencies.hilt_compiler

//Gson
implementation Dependencies.gson

//reflection
testImplementation Dependencies.kotlin_reflect

//coroutine testing
testImplementation Dependencies.coroutines_test
//datastore
implementation Dependencies.datastore_preferences
implementation(Dependencies.coroutines_android)

//for Ui testing
androidTestImplementation(Dependencies.test_runner)
androidTestImplementation(Dependencies.test_rules)
androidTestImplementation(Dependencies.ui_automator)
implementation(Dependencies.espresso_contrib)
}
build.gradle(ServiceApp)

Код: Выделить всё

plugins {
id 'com.android.library'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'jacoco'
}

jacoco {
toolVersion("0.8.11")
}
apply from:"$project.rootDir/jacoco.gradle"

android {
namespace 'com.example.testservice'
compileSdk 32

defaultConfig {
minSdk 31
targetSdk 32

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildFeatures {
buildConfig true
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
dataBinding {
enabled = true
}
kotlinOptions {
jvmTarget = '11'
}
testOptions {
unitTests.returnDefaultValues = true
unitTests.includeAndroidResources = true
}
}

dependencies {
api fileTree(include: ['*.jar'], dir:  'libs')
api project(":telematicslib")
implementation Dependencies.core_ktx
implementation Dependencies.appcompat
implementation Dependencies.material

//HiveMQ
implementation(Dependencies.mqtt_client)

//Retrofit
implementation(Dependencies.retrofit)
//Gson converter
implementation(Dependencies.gson_retrofit_converter)
implementation(Dependencies.okHttpLoggingInterceptor)
implementation files('libs\\extension-V1.0-java.jar')

testApi Dependencies.test_junit
androidTestApi Dependencies.ext_junit
androidTestApi Dependencies.espresso_core

//datastore
implementation Dependencies.datastore_preferences
implementation(Dependencies.coroutines_android)

//Hilt
implementation(Dependencies.hilt_android)
kapt(Dependencies.hilt_compiler)

//Mockito
testApi (Dependencies.mockito_core)
testApi (Dependencies.mockito_kotlin)
//core testing
testApi Dependencies.core_testing

// Hilt testing dependency
testApi Dependencies.hilt_android_testing
// Make Hilt generate code in the androidTest folder
kaptAndroidTest Dependencies.hilt_compiler

//reflection
testApi Dependencies.kotlin_reflect

//coroutine testing
testApi Dependencies.coroutines_test
}
Я попробовал выполнить следующие действия:

[*]Android Studio -> Файл -> Недействительный кеш/перезапуск[*]Удалена папка сборки из «Моего приложения».
[*]Сборка ---> очистить проект, Сборка ---> Перестроить проект.
[*]Перезапущен. Ноутбук, Android Studio
[*]Он работает, когда я меняю компиляцию и целевой SDK на 33. Но мне нужно работать с моим приложением в SDK 32.


Подробнее здесь: https://stackoverflow.com/questions/781 ... p-cant-run
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Android»