Following the migration guide:
We run into two problems:
First, we are unable to finish building because of duplicate classes:
Duplicate class android.support.v4.media.session.PlaybackStateCompat$CustomAction$1 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$CustomAction$Builder found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$ErrorCode found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$MediaKeyAction found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$RepeatMode found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$ShuffleMode found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompat$State found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompatApi21 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompatApi21$CustomAction found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.media.session.PlaybackStateCompatApi22 found in modules media-1.0.0-runtime (androidx.media:media:1.0.0) and support-media-compat-27.1.1-runtime (com.android.support:support-media-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.10.0-runtime (androidx.core:core:1.10.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Go to the documentation to learn how to Fix dependency resolution errors.
If we re-enable andorid.enableJetifier=true then we get past the duplicate classes error and can finish building but then we get a runtime error of:
Blockquote
2023-05-22 13:03:19.772 10981-10981 AndroidRuntime pid-10981 E FATAL EXCEPTION: main
Process: com.tigoenergy.smart, PID: 10981
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tigoenergy.smart/com.tigoenergy.smart.MainActivity}: java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity.
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4169)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
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.initWindowDecorActionBar(AppCompatDelegateImpl.java:550)
at androidx.appcompat.app.AppCompatDelegateImpl.getSupportActionBar(AppCompatDelegateImpl.java:537)
at androidx.appcompat.app.AppCompatDelegateImpl.invalidateOptionsMenu(AppCompatDelegateImpl.java:1220)
at androidx.appcompat.app.AppCompatActivity.invalidateOptionsMenu(AppCompatActivity.java:314)
at androidx.activity.ComponentActivity.invalidateMenu(ComponentActivity.java:588)
at androidx.activity.ComponentActivity$$ExternalSyntheticLambda0.run(Unknown Source:2)
at androidx.core.view.MenuHostHelper.addMenuProvider(MenuHostHelper.java:133)
at androidx.activity.ComponentActivity.addMenuProvider(ComponentActivity.java:566)
at androidx.fragment.app.FragmentActivity$HostCallbacks.addMenuProvider(FragmentActivity.java:736)
at androidx.fragment.app.FragmentManager.attachController(FragmentManager.java:2795)
at androidx.fragment.app.FragmentController.attachHost(FragmentController.java:117)
at androidx.fragment.app.FragmentActivity.lambda$init$3$androidx-fragment-app-FragmentActivity(FragmentActivity.java:140)
at androidx.fragment.app.FragmentActivity$$ExternalSyntheticLambda3.onContextAvailable(Unknown Source:2)
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable(ContextAwareHelper.kt:84)
at androidx.activity.ComponentActivity.onCreate(ComponentActivity.java:377)
at androidx.fragment.app.FragmentActivity.onCreate(FragmentActivity.java:217)
at com.getcapacitor.BridgeActivity.onCreate(BridgeActivity.java:23)
at android.app.Activity.performCreate(Activity.java:8591)
at android.app.Activity.performCreate(Activity.java:8570)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:4150)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4325)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
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:2574)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8757)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
---------------------------- PROCESS ENDED (10981) for package com.tigoenergy.smart ----------------------------