Status Update
Comments
vi...@google.com <vi...@google.com>
ad...@google.com <ad...@google.com> #2
Hey Peter, this seems like it could be an issue with connecting to the process.
da...@google.com <da...@google.com> #3
Peter, I'm in communication with this user on Twitter. They were super friendly and asked if we had enough information here. Can you tell if this is the same issue as the other one you looked at last week?
pe...@google.com <pe...@google.com> #4
Hi
an...@gmail.com <an...@gmail.com> #5
pe...@google.com <pe...@google.com> #6
Hi, we'll need more information to investigate this issue. Could you please follow these steps and reply with the command line outputs? Your help is greatly appreciated.
- Attempt to use Database Inspector or Layout Inspector on the app once. It's OK if this step is unsuccessful.
- In Android Studio, close Database Inspector, Layout Inspector, or Profiler tool windows.
- Disconnect and re-connect the device.
- In Android Studio, click Run > Run... to launch the app on the device.
- Clear logcat (e.g., adb logcat -c)
- In a terminal, run adb shell. In the adb shell, run:
$ run-as PACKAGE_NAME
$ pwd
. What's the output?$ ls code_cache/
. What's the output? Three files are expected: libjvmtiagent_x86.so, perfa.jar, transport. Note libjvmtiagent_x86.so may be named libjvmtiagent_arm64.so depending on the device's ISA.$ exit
. This will end the run-as session.- You should be in the regular adb shell session. Run
$ cmd activity attach-agent PACKAGE_NAME /data/data/PACKAGE_NAME/code_cache/libjvmtiagent_x86.so=/data/local/tmp/perfd/agent.config
. What's the output? - Check logcat. Are there any errors? In particular, if you search for whole word 'avc', are there any hits? They often indicate permission errors.
If you can send back the outputs from Steps 8, 9, 11, 12, that will help us better understand the issue. Your help is appreciated!
an...@gmail.com <an...@gmail.com> #7
11th command gave following error
W/m.aumhum.aumhu: Agent attach failed (result=1) : Unable to dlopen /data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so: dlopen failed: library "/data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so" not found
E/ActivityThread: Attaching agent with dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.aumhum.aumhum-xEctoCVhfayqYcSCQoCKAg==/base.apk"],nativeLibraryDirectories=[/data/app/com.aumhum.aumhum-xEctoCVhfayqYcSCQoCKAg==/lib/arm64, /data/app/com.aumhum.aumhum-xEctoCVhfayqYcSCQoCKAg==/base.apk!/lib/arm64-v8a, /system/lib64, /system/product/lib64]]] failed: /data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so=/data/local/tmp/perfd/agent.config
E/ActivityThread: Attaching agent with null failed: /data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so=/data/local/tmp/perfd/agent.config
W/m.aumhum.aumhu: Agent attach failed (result=1) : Unable to dlopen /data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so: dlopen failed: library "/data/data/com.aumhum.aumhum/code_cache/libjvmtiagent_x86.so" not found
I have also attached the logs with avc in it .
I am on custom rom does this have to do anything with that ?
pe...@google.com <pe...@google.com> #8
Hi ls code_cache/
shows the libraries and jars that are used to run the underlying pipeline are not present. (the tech that database inspector runs on).
I don't know about the custom rom because it's outside my area of expertise, but it might very well be it. We recently had a user come in with a similar issue and they were running SELinux. They fixed it by disabling SELinux.
I'm CCing shukang@ who knows more about the pipeline.
da...@google.com <da...@google.com> #9
Indeed Shukang knows the most here. He's OOO so he won't reply today.
However! The fact that you are reporting that JVMTI is not found is probably a pretty severe issue that seems likely due to it being custom ROM, yes.
For background, the Android framework team added JVMTI to Android in O. (JVMTI is a standard, you can read more about it online if you do a quick search, but in Android O we wrote our own implementation).
Note that the framework team added tests to a large suite of OS tests that. Therefore, we verify 1) that JVMTI is available in O+ and 2) for any device to be certified official, they also have to pass these tests. However, if you're using a custom ROM, it sounds like there are no such guarantees there....
My guess is you'll have to do inspection work on an official ROM or device for now.
I'm going to close this bug as infeasible, but please continue to keep adding more information here if you had more questions or wanted to provide more evidence for why we should keep it open.
sh...@google.com <sh...@google.com> #10
an...@mx51.io <an...@mx51.io> #11
My code_cache/ directory is also empty, and I'm running on some custom hardware with a custom OS install (based on Android O).
I tried looking for them on my mobile phone (running Android 12) to see if I could copy them, but they were missing there too.
Is there a way to get the missing JVMTI .so and .jar files and side-load them to enable the database inspector?
sh...@google.com <sh...@google.com> #12
/data/local/tmp/perfd
on the device? If so, you can copy these three files (libjvmtiagent_x86_64.so, perfa.jar, transport
) from there to the code_cache/ directory. The _86_64
suffix may change depending on the hardware.
bi...@gmail.com <bi...@gmail.com> #13
Does google verify, if the OEM firmware supports Database inspector, before certification ?
ro...@gmail.com <ro...@gmail.com> #14
I copied those three files (libjvmtiagent_arm64.so, perfa.jar, transport
) to /data/data/PAKCAGE/code_cache
directory, and run that cmd activity attach-agent ...
command in adb shell, here's the log in brief: (full log in attachment)
18:42:42.116 PACKAGE_NAME W type=1400 audit(0.0:29): avc: granted { execute } for path="/data/data/PACKAGE_NAME/code_cache/libjvmtiagent_arm64.so" dev="sda17" ino=1426319 scontext=u:r:untrusted_app:s0:c100,c257,c512,c768 tcontext=u:object_r:app_data_file:s0:c100,c257,c512,c768 tclass=file app=PACKAGE_NAME
18:42:42.166 libc E Access denied finding property "ro.serialno"
18:42:42.163 PACKAGE_NAME W type=1400 audit(0.0:30): avc: denied { read } for name="u:object_r:serialno_prop:s0" dev="tmpfs" ino=18827 scontext=u:r:untrusted_app:s0:c100,c257,c512,c768 tcontext=u:object_r:serialno_prop:s0 tclass=file permissive=0 app=PACKAGE_NAME
18:42:42.213 PACKAGE_NAME W DexFile /data/data/PACKAGE_NAME/code_cache/perfa.jar is in boot class path but is not in a known location
18:42:42.767 StudioProfiler V Transformed class: android/app/PendingIntent
.... Transformed class... x 14 lines
18:42:49.489 PACKAGE_NAME W Current dex file has more than one class in it. Calling RetransformClasses on this class might fail if no transformations are applied to it!
.... Current dex file... x 14 lines
18:42:49.490 PACKAGE_NAME W Accessing hidden method Landroid/app/PendingIntent;-><clinit>()V (blacklist, linking, allowed)
.... Accessing hidden method many many lines
18:42:49.635 PACKAGE_NAME W Accessing hidden field Landroid/app/IntentService;->mRedelivery:Z (greylist-max-o, linking, allowed)
18:42:49.674 PACKAGE_NAME W Class android.os.PowerManager$WakeLock failed lock verification and will run slower.
18:42:49.714 StudioProfiler V Profiler initialization complete on agent.
18:42:49.731 StudioProfiler V Acquiring Application for Events
It seems the agent initialization has completed? But the "App Inspection" tab is still empty. How can I do to help investigate further?
Description
Build #AI-201.7223.91.41.6565218, built on June 6, 2020
Runtime version: 1.8.0_242-release-1644-b01 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
GC: ParNew, ConcurrentMarkSweep
Memory: 1237M
Cores: 8
Registry: ide.new.welcome.screen.force=true
Version of Gradle Plugin: classpath 'com.android.tools.build:gradle:3.4.1'
Version of Gradle: distributionUrl=https\://
Version of Java: JavaVersion.VERSION_1_8
OS: System os windows 10 , device os : Android 10
Steps to Reproduce:
1. Run the project on device
2. Open database inspector on android studio and nothing shows up
Screen shot:-
The database is present on device , I can see it via device file explorer
Database inspector works fine on emulator running Api 29
PFA of the log