Skip to content

Adapt to Android 17 - #103

Open
iusmac wants to merge 12 commits into
17.0-devfrom
feat-adapt-to-android-17
Open

iusmac wants to merge 12 commits into
17.0-devfrom
feat-adapt-to-android-17

Conversation

@iusmac

@iusmac iusmac commented Nov 21, 2026

Copy link
Copy Markdown
Owner

No description provided.

@iusmac iusmac changed the title Feat adapt to android 17 Adapt to Android 17 Nov 21, 2026
* Support for SDK 37 (A17).
* Fixes:
  > Failed to apply plugin 'org.jetbrains.kotlin.android'.
     > ⛔ Failed to apply plugin 'org.jetbrains.kotlin.android'
       The 'org.jetbrains.kotlin.android' plugin is no longer required for Kotlin support since AGP 9.0.
       Solution: Remove the 'org.jetbrains.kotlin.android' plugin from this project's build file: build.gradle.
* Also fixes:
    e: file:///../.../transformed/roborazzi-1.79.0-api.jar!/META-INF/roborazzi_release.kotlin_module Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.3.0, expected version is 2.1.0.
@iusmac
iusmac force-pushed the feat-adapt-to-android-17 branch 2 times, most recently from c39805b to 6040eb2 Compare November 24, 2026 10:31
* applicationVariants was removed in the new AGP 9 DSL. Fixes:
    > Could not get unknown property 'applicationVariants' for object of type com.android.build.gradle.internal.dsl.ApplicationExtensionImpl$AgpDecorated.
@iusmac
iusmac force-pushed the feat-adapt-to-android-17 branch 2 times, most recently from 087cf2d to 49d64ee Compare November 24, 2026 14:38
* Need at least v0.9.5 (Kotlin/kotlinx-kover#785)
  to address the following:

    Task 'koverHtmlReportDebug' not found in root project '7SIM' and its subprojects.
* Needed after migrating to the AGP's 9.0 new built-in Kotlin support,
  that no longer mirrors java.srcDirs into kotlin.srcDirs.
* Do it also for the test source sets.
* Dagger/Hilt 2.59 added explicit support for AGP 9.0's built-in Kotlin.
* Starting with AGP 9.0 need to also add library to "testCompileOnly".
* Add a flag to enable it only in app (not in SettingsLib deps), so that
  tests cam resolve the "@hide" symbols from the prebuilt android.jar.
* NOTE: KotlinCompile now uses "libraries.setFrom" instead of
  "libraries.from".

Log:

 > Task :kaptDebugUnitTestKotlin
  e: file:///home/runner/work/7SIM/7SIM/tests/test/java/com/github/iusmac/sevensim/test/EspressoUtils.kt:106:18 Unresolved reference 'viewRootImpl'.
@iusmac
iusmac force-pushed the feat-adapt-to-android-17 branch 3 times, most recently from e2602f6 to b41b51a Compare November 26, 2026 16:00
* Starting from robolectric-4.17-beta-1, need to explicitly drain the
  specified looper (main in our case) in order to process the
  OnSubscriptionsChangedListener callbacks. See for reference:
  robolectric/robolectric@188726b
  ("Update ShadowSubscriptionManager to dispatch
  OnSubscriptionsChangedListeners on the owner's specified Executor").

* While we're at it, replace all anonymous lambdas with dedicated
  DummySubscriptionsChangedListener class for an easier managing of
  subscription changed counter.
---

Log:

java.lang.AssertionError:
Expected: is [<2>, <2>]
     but: was [<1>, <2>]
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:6)
	at com.github.iusmac.sevensim.telephony.SubscriptionsTest.test_notifyAllListeners(SubscriptionsTest.java:448)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.mockito.internal.junit.JUnitSessionStore$1.evaluateSafely(JUnitSessionStore.java:55)
	at org.mockito.internal.junit.JUnitSessionStore$1.evaluate(JUnitSessionStore.java:43)
	at dagger.hilt.android.internal.testing.MarkThatRulesRanRule$1.evaluate(MarkThatRulesRanRule.java:108)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:547)
	at org.robolectric.internal.SandboxTestRunner.lambda$executeInSandbox$4(SandboxTestRunner.java:427)
	at org.robolectric.internal.SandboxTestRunner.runInSandbox(SandboxTestRunner.java:453)
	at org.robolectric.internal.SandboxTestRunner.executeInSandbox(SandboxTestRunner.java:418)
	at org.robolectric.internal.SandboxTestRunner$5.evaluate(SandboxTestRunner.java:403)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.robolectric.internal.SandboxTestRunner.access$000(SandboxTestRunner.java:64)
	at org.robolectric.internal.SandboxTestRunner$4.evaluate(SandboxTestRunner.java:292)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:259)
	at org.robolectric.internal.SandboxTestRunner$3.lambda$evaluate$0(SandboxTestRunner.java:278)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThreadWithClassLoader$1(Sandbox.java:110)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Unknown Source)
	Suppressed: org.robolectric.android.internal.AndroidTestEnvironment$UnExecutedRunnablesException: Main looper has queued unexecuted runnables. This might be the cause of the test failure. You might need a shadowOf(Looper.getMainLooper()).idle() call.
@iusmac
iusmac force-pushed the feat-adapt-to-android-17 branch 10 times, most recently from 4a3740b to 3a3bc59 Compare November 29, 2026 14:29
@iusmac
iusmac force-pushed the feat-adapt-to-android-17 branch 3 times, most recently from c8ed855 to a025474 Compare November 29, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant