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

Fix assembly not found on Android in Debug configuration #2175

Merged
merged 2 commits into from
Feb 11, 2023
Merged

Conversation

mattjohnsonpint
Copy link
Contributor

Noticed that when building an Android app in debug configuration, with Sentry debugging on, I was seeing failures reading the assembly to create debug info:

Debug: Creating SentryStackTrace. isCurrentStackTrace: False.
Debug: Couldn't find assembly /data/data/com.companyname.mymauiapp/files/.__override__/MyMauiApp.dll in the APK
Debug: Skipping DebugImage for module 'MyMauiApp.dll' because assembly wasn't found: '/data/data/com.companyname.mymauiapp/files/.__override__/MyMauiApp.dll'
Debug: Couldn't find assembly /data/data/com.companyname.mymauiapp/files/.__override__/Microsoft.Maui.Controls.dll in the APK
Debug: Skipping DebugImage for module 'Microsoft.Maui.Controls.dll' because assembly wasn't found: '/data/data/com.companyname.mymauiapp/files/.__override__/Microsoft.Maui.Controls.dll'
Debug: Couldn't find assembly /data/data/com.companyname.mymauiapp/files/.__override__/Microsoft.Maui.dll in the APK
Debug: Skipping DebugImage for module 'Microsoft.Maui.dll' because assembly wasn't found: '/data/data/com.companyname.mymauiapp/files/.__override__/Microsoft.Maui.dll'
Debug: Couldn't find assembly /data/data/com.companyname.mymauiapp/files/.__override__/Mono.Android.dll in the APK
Debug: Skipping DebugImage for module 'Mono.Android.dll' because assembly wasn't found: '/data/data/com.companyname.mymauiapp/files/.__override__/Mono.Android.dll'
Debug: Created DebugStackTrace with 10 frames.

On closer inspection, it looks like assemblies are only embedded in the APK in release mode. In debug mode, they're put on disk as normal files.

Updating the Android assembly reader to use the file on disk if it exists.

@vaind vaind merged commit b98e8f5 into main Feb 11, 2023
@vaind vaind deleted the fix/android-apk branch February 11, 2023 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants