1

Recently started using C++ in a Java Android app with CMake and Gradle on Windows (based on https://developer.android.com/studio/projects/gradle-external-native-builds). It works great, but now Java logs are not showing up in the Console when debugging the app. When it starts, it shows both an app and app-java process and neither of them show anything expected (such as touch events). Any way to fix this?

app:

12/05 20:12:12: Launching 'app' on samsung.
Install successfully finished in 6 s 531 ms.
$ adb shell am start -n "com.agragps.agragps/com.agragps.agragps.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.agragps.agragps
Connecting to com.agragps.agragps
Now Launching Native Debug Session
$ adb shell cat /data/local/tmp/lldb-server | run-as com.agragps.agragps sh -c 'cat > /data/data/com.agragps.agragps/lldb/bin/lldb-server && chmod 700 /data/data/com.agragps.agragps/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh | run-as com.agragps.agragps sh -c 'cat > /data/data/com.agragps.agragps/lldb/bin/start_lldb_server.sh && chmod 700 /data/data/com.agragps.agragps/lldb/bin/start_lldb_server.sh'
Starting LLDB server: /data/data/com.agragps.agragps/lldb/bin/start_lldb_server.sh /data/data/com.agragps.agragps/lldb unix-abstract /com.agragps.agragps-0 platform-1670296340839.sock "lldb process:gdb-remote packets"
Debugger attached to process 18174

app-java:

Connected to the target VM, address: 'localhost:53082', transport: 'socket'
cj-
  • 167
  • 1
  • 12
  • Touch events aren't logged, unless you do it explicitly. – Gabe Sechan Dec 06 '22 at 03:35
  • `D/ViewRootImpl@5737565[MainActivity]: ViewPostIme pointer 1 D/ViewRootImpl@5737565[MainActivity]: ViewPostIme pointer 0` These are the events that I am referring to. The exact logs are not important, what matters are no logs are appearing. – cj- Dec 06 '22 at 04:22
  • I'm facing the same problem, I didn't know the cause of it, but we have recently added a C++ module to the app, I never imagined that could be related – Adam Burley May 14 '23 at 23:33
  • I just tried with a clean empty project without any C++ and it had the same issue. it's some change in a recent version of Android Studio I think. not sure if it's possible to change it back via some setting. – Adam Burley May 14 '23 at 23:58
  • This has happened to me only with branches containing C++. Same Java code (and Kotlin), Android Studio and device. So I agree, probably a configuration bug – cj- May 15 '23 at 16:17

0 Answers0