library and sample to access to UVC web camera on non-rooted Android device
2.96k
stars
1.19k
forks
source link
java.lang.RuntimeException: Unable to start activity ComponentInfo : java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity #692
I got the following error.
I update realm to avoid error transform and also include tools:replace="android:theme" in my manifest following some suggestions from others.
I couldn´t solve this yet and i have no idea how to solve it. Thanks for any suggest.
FATAL EXCEPTION: main
Process: com.example.emojigarden, PID: 17315
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.emojigarden/com.example.emojigarden.MainActivity}:
java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3506)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3681)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2130)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:250)
at android.app.ActivityThread.main(ActivityThread.java:7803)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:846)
at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:705)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:207)
at androidx.activity.compose.ComponentActivityKt.setContent(ComponentActivity.kt:67)
at androidx.activity.compose.ComponentActivityKt.setContent$default(ComponentActivity.kt:48)
at com.example.emojigarden.MainActivity.onCreate(MainActivity.kt:35)
at android.app.Activity.performCreate(Activity.java:8104)
at android.app.Activity.performCreate(Activity.java:8088)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3479)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3681)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2130)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:250)
at android.app.ActivityThread.main(ActivityThread.java:7803)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
// For Jetpack Compose
implementation "androidx.compose.ui:ui:$compose_version"
implementation "androidx.compose.material:material:$compose_version"
implementation "androidx.compose.ui:ui-tooling:$compose_version"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.3.1'
implementation 'androidx.activity:activity-ktx:1.3.0' // also ViewModels
implementation 'androidx.activity:activity-compose:1.3.0'
// For the viewModel function that imports them into activities
implementation 'androidx.activity:activity-ktx:1.3.0'
// For the ViewModelScope if using Coroutines in the ViewModel
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07"
/ Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
compose_version = '1.0.0'
kotlin_ext = '1.5.10'
}
repositories {
mavenCentral()
}
dependencies {
//classpath "io.realm:realm-gradle-plugin:10.11.1"// with this error transform deprecated api
classpath "io.realm:realm-gradle-plugin:10.15.1"
}
}
plugins {
id 'com.android.application' version '8.0.1' apply false
id 'com.android.library' version '8.0.1' apply false
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
id "org.jetbrains.kotlin.kapt" version "1.6.20" apply false
id 'io.realm.kotlin' version '1.6.1' apply false
Kotlin, AndroidStudio Flamingo
Im following App to sync Realm to MongoAtlas https://github.com/mongodb-developer/EmojiGarden/tree/main
I got the following error. I update realm to avoid error transform and also include tools:replace="android:theme" in my manifest following some suggestions from others. I couldn´t solve this yet and i have no idea how to solve it. Thanks for any suggest.
FATAL EXCEPTION: main Process: com.example.emojigarden, PID: 17315 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.emojigarden/com.example.emojigarden.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3506) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3681) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2130) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:250) at android.app.ActivityThread.main(ActivityThread.java:7803) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity. at androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor(AppCompatDelegateImpl.java:846) at androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor(AppCompatDelegateImpl.java:809) at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:705) at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:207) at androidx.activity.compose.ComponentActivityKt.setContent(ComponentActivity.kt:67) at androidx.activity.compose.ComponentActivityKt.setContent$default(ComponentActivity.kt:48) at com.example.emojigarden.MainActivity.onCreate(MainActivity.kt:35) at android.app.Activity.performCreate(Activity.java:8104) at android.app.Activity.performCreate(Activity.java:8088) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3479) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3681) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2130) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:250) at android.app.ActivityThread.main(ActivityThread.java:7803) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958)
My Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.emojigarden">
My BuildGradle app: plugins { id 'com.android.application' id 'kotlin-android' id 'kotlin-kapt' id 'realm-android' }
realm { syncEnabled = true }
android { namespace 'com.example.emojigarden' compileSdk 33
}
dependencies { implementation 'androidx.core:core-ktx:1.6.0' implementation 'androidx.appcompat:appcompat:1.3.1' implementation 'com.google.android.material:material:1.4.0'
// For the viewModel function that imports them into activities implementation 'androidx.activity:activity-ktx:1.3.0'
// For the ViewModelScope if using Coroutines in the ViewModel implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' implementation "androidx.lifecycle:lifecycle-viewmodel-compose:1.0.0-alpha07"
}
My BuildGradle (Project)
/ Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext { compose_version = '1.0.0' kotlin_ext = '1.5.10'
}
plugins { id 'com.android.application' version '8.0.1' apply false id 'com.android.library' version '8.0.1' apply false id 'org.jetbrains.kotlin.android' version '1.7.20' apply false id "org.jetbrains.kotlin.kapt" version "1.6.20" apply false id 'io.realm.kotlin' version '1.6.1' apply false
}
task clean(type: Delete) { delete rootProject.buildDir }