Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.IllegalStateException: Failed to compile (out=Error: Failed to cpmpile ! #283

Closed
vikasraimeesho opened this issue May 5, 2024 · 3 comments
Assignees
Labels

Comments

@vikasraimeesho
Copy link

vikasraimeesho commented May 5, 2024

java.lang.IllegalStateException: Failed to compile (out=Error: Failed to cpmpile !
)
at androidx.benchmark.macro.CompilationMode$Companion.cmdPackageCompile$benchmark_macro_release(CompilationMode.kt:434)
at androidx.benchmark.macro.CompilationMode$Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:307)
at androidx.benchmark.macro.CompilationMode.resetAndCompile$benchmark_macro_release(CompilationMode.kt:114)
at androidx.benchmark.macro.CompilationMode.resetAndCompile$benchmark_macro_release$default(CompilationMode.kt:75)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:237)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:436)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:107)
at com.meesho.baselineprofile.StartupBenchmarks.benchmark(StartupBenchmarks.kt:52)
at com.meesho.baselineprofile.StartupBenchmarks.startupCompilationBaselineProfiles()

I'm trying to add benchmark profile for my project. Below is the generated code by the android studio. The startupCompilationNone() method is compiling fine but startupCompilationBaselineProfiles is getting failed with above stacktrace.

@RunWith(AndroidJUnit4::class)
@LargeTest
class StartupBenchmarks {

    @get:Rule
    val rule = MacrobenchmarkRule()

    @Test
    fun startupCompilationNone() =
        benchmark(CompilationMode.None())

    @Test
    fun startupCompilationBaselineProfiles() =
        benchmark(CompilationMode.Partial(BaselineProfileMode.Require))

    private fun benchmark(compilationMode: CompilationMode) {
        // This example works only with the variant with application id `com.example.myapplication`."
        rule.measureRepeated(
            packageName = "com.example.myapplication",
            metrics = listOf(StartupTimingMetric()),
            compilationMode = compilationMode,
            startupMode = StartupMode.COLD,
            iterations = 10,
            setupBlock = {
                pressHome()
            },
            measureBlock = {
                startActivityAndWait()

                // TODO Add interactions to wait for when your app is fully drawn.
                // The app is fully drawn when Activity.reportFullyDrawn is called.
                // For Jetpack Compose, you can use ReportDrawn, ReportDrawnWhen and ReportDrawnAfter
                // from the AndroidX Activity library.

                // Check the UiAutomator documentation for more information on how to
                // interact with the app.
                // https://d.android.com/training/testing/other-components/ui-automator
            }
        )
    }
}
@keyboardsurfer
Copy link
Member

Thanks for bringing this up. This does not look like an issue with the sample to me. Can you verify that this occurs on the sample app in this repository?

@keyboardsurfer keyboardsurfer added the more info needed Need more info from the assignee label May 6, 2024
@vikasraimeesho
Copy link
Author

vikasraimeesho commented May 9, 2024

@keyboardsurfer I just verified it, Its happening on the sample app as well.

com.example.macrobenchmark.benchmark.startup.ColdStartupBenchmark > startupFullCompilation[RMX1992 - 11] FAILED 
	java.lang.IllegalStateException: Failed to compile (out=Error: Failed to cpmpile !
	)

@vikasraimeesho vikasraimeesho removed their assignment May 9, 2024
@keyboardsurfer
Copy link
Member

This could be a device specific issue as we don't observe this with the benchmarking sample in general. Please file a bug against benchmarking and include details on the device setup you're using there.

@keyboardsurfer keyboardsurfer closed this as not planned Won't fix, can't repro, duplicate, stale Sep 10, 2024
@keyboardsurfer keyboardsurfer added stale and removed more info needed Need more info from the assignee labels Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants