No Baseline profile found in target apk

803 Views Asked by At

I am trying to use baseline profile generated and run benchmark test. Despite copying baseline profile, I am still facing issues. I copied it in all variant folders just to make sure its not missed, still getting file not found exception.

java.lang.RuntimeException: No baseline profile was found in the target apk.
    at androidx.benchmark.macro.CompilationMode$Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:339)
    at androidx.benchmark.macro.CompilationMode.resetAndCompile$benchmark_macro_release(CompilationMode.kt:76)
    at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:139)
    at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:301)
    at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:106)
    at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated$default(MacrobenchmarkRule.kt:96)
    at com.example.mobile.android.beta.benchmark.exampleStartupBenchmark.startup(ExampleStartupBenchmark.kt:44)
    at com.example.mobile.android.beta.benchmark.exampleStartupBenchmark.startUpCompilationModePartial(ExampleStartupBenchmark.kt:35)


02-03 16:51:28.498  9721  9721 D ProfileInstaller: Installing profile for com.example.mobile.android.beta.test
02-03 16:51:28.499  9721  9780 V FA      : Connecting to remote service
02-03 16:51:28.501  9721  9721 E ProfileInstaller: RESULT_BASELINE_PROFILE_NOT_FOUND
02-03 16:51:28.501  9721  9721 E ProfileInstaller: java.io.FileNotFoundException: dexopt/baseline.prof
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.content.res.AssetManager.nativeOpenAsset(Native Method)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.content.res.AssetManager.open(AssetManager.java:904)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.content.res.AssetManager.open(AssetManager.java:881)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at androidx.profileinstaller.DeviceProfileWriter.read(DeviceProfileWriter.java:163)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at androidx.profileinstaller.ProfileInstaller.transcodeAndWrite(ProfileInstaller.java:434)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at androidx.profileinstaller.ProfileInstaller.writeProfile(ProfileInstaller.java:565)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at androidx.profileinstaller.ProfileInstallReceiver.onReceive(ProfileInstallReceiver.java:104)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.app.ActivityThread.handleReceiver(ActivityThread.java:4306)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.app.ActivityThread.-$$Nest$mhandleReceiver(Unknown Source:0)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2153)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.os.Handler.dispatchMessage(Handler.java:106)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.os.Looper.loopOnce(Looper.java:201)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.os.Looper.loop(Looper.java:288)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at android.app.ActivityThread.main(ActivityThread.java:7872)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at java.lang.reflect.Method.invoke(Native Method)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
02-03 16:51:28.501  9721  9721 E ProfileInstaller:  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)example

base line profile added in main Even after adding baseline profile to main, it still gives me error.

1

There are 1 best solutions below

0
On

Just double check your package name in the test you running.