adelphes / android-dev-ext

Android debugging support for VS Code
https://marketplace.visualstudio.com/items?itemName=adelphes.android-dev-ext
MIT License
216 stars 29 forks source link

Warning: No source files found. Check the "appSrcRoot" setting in launch.json #146

Closed randallrvr closed 9 months ago

randallrvr commented 9 months ago

I'm following a somewhat unorthodox model to create my apks similar to https://github.com/cnlohr/rawdrawandroid, in which I've scripted the compilation, packaging, signing, zipaligning... etc. which works, but I'm currently not able to hit breakpoints in my src code.

I'm pointing "appSrcRoot" to the correct folder where my source code lives, but I wouldn't call it the "app source tree", and its not where AndroidManifest.xml lives. I am pointing to the "manifestFile" explicitly.

I'm unclear on what exactly the extension requires, do I need to adopt a more conventional file structure?

Current output:

Warning: No source files found. Check the "appSrcRoot" setting in launch.json
Checking build
Warning: Build is not up-to-date. Source files may not match execution when debugging.
Searching for devices...
Found 1 device
Current build already installed
Launching on device e9646fd7 [API:34]
Using custom launch arguments '-D -N --activity-brought-to-front -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -n com.test.testApp/android.app.NativeActivity'

My 'launch.json' config

            "name"            : "Remote APK Debug",
            "type"            : "android",
            "request"         : "launch",
            "appSrcRoot"      : "${workspaceFolder}/src/",
            "apkFile"         : "${workspaceFolder}/build/testApp.apk",
            "manifestFile"    : "${workspaceFolder}/build/AndroidManifest.xml",
            "staleBuild"      : "warn",
            "targetDevice"    : "e9646fd7",
            "autoStartADB"    : true,
            "postLaunchPause" : 1000,
            "pmInstallArgs"   : ["-r"],
            "trace"           : false,
            "amStartArgs": [
                "-D",
                "-N",
                "--activity-brought-to-front",
                "-a android.intent.action.MAIN",
                "-c android.intent.category.LAUNCHER",
                "-n com.test.testApp/android.app.NativeActivity",
            ],
randallrvr commented 9 months ago

I've tried moving my source files to "${workspaceFolder}/app/src/main/", but the result is the same.

adelphes commented 9 months ago

What language is the app is coded in?

If it's native c/cpp files, it's not going to work. The extension uses the Java (JDWP) debugger on the client device, so only Java and Kotlin source files are supported.

randallrvr commented 9 months ago

That makes sense then, this is all c/c++ using the native_app_glue.