Repository navigation
.NET 10 Android: DexGuard-protected AAR fails to load encrypted classes (regression from .NET 9) #10615
Description
Full transparency, I had Cursor / AI generate issue content to match this template and a repro project to hopefully provide better information and speed up the process for you.
Android framework version
net10.0-android (Preview)
Affected platform version
.NET Version: 10.0.100 (fails), 9.0.306 (works) Android SDK: API 21-36 (tested multiple versions) MAUI Version: 10.0.0/10.0.100 OS: macOS Darwin 25.1.0
Description
AAR files using DexGuard asset encryption fail to load dynamically-decrypted classes at runtime in .NET 10 Android. This is a regression - the same code and AAR work correctly in .NET 9.
The Problem
The FaceTec SDK (versions 9.7.79, 9.7.97) uses DexGuard to encrypt and protect their implementation. Some obfuscated classes are encrypted and stored in asset files, which should be dynamically decrypted and loaded at runtime by DexGuard's ClassLoader.
In .NET 9, this works perfectly. In .NET 10, the encrypted classes fail to load, causing immediate crashes.
Root Cause Evidence
The missing class doesn't exist in classes.jar:
unzip -p facetec-sdk-9.7.97.aar classes.jar | jar tf | grep "ipB21035"
# Result: (empty) - because it's encrypted in assetsThe encrypted assets ARE in the AAR and APK:
unzip -l facetec-sdk-9.7.97.aar | grep "assets/com/facetec/sdk"
# Shows encrypted asset files: 8ece9efb0c7e6bd9a-, a5b5981bf398ec36b-, etc.DexGuard configuration confirms asset encryption:
unzip -p facetec-sdk-9.7.97.aar dexguard.txt
# Shows:
# -encryptassetfiles !assets/com/facetec/sdk/...
# -keepresourcefiles assets/com/facetec/sdk/...Steps to Reproduce
I've created a minimal reproduction project with complete setup files.
Reproduction Project Structure:
repro-net10-dexguard/
├── FaceTecNet10Repro.sln # Solution with both projects
├── global.json # Pins SDK to 10.0.100
├── workload.json # Workload versions for reproducibility
├── FaceTecBinding/ # Minimal Android binding
│ ├── FaceTecBinding.csproj # IsTrimmable=false, TrimMode=copy
│ └── facetec-sdk-9.7.97.aar # DexGuard-protected AAR (included)
└── FaceTecMinimalRepro/ # Multi-targeted MAUI app
├── FaceTecMinimalRepro.csproj # Targets: net9.0-android + net10.0-android
└── MainActivity.cs # Simply references FaceTec type
Steps:
-
Open the reproduction project:
cd repro-net10-dexguard open FaceTecNet10Repro.sln -
Build and run with .NET 10:
dotnet build -f net10.0-android dotnet publish -f net10.0-android # Install APK on device and launchResult: Immediate crash with
ClassNotFoundException -
Build and run with .NET 9:
dotnet build -f net9.0-android dotnet publish -f net9.0-android # Install APK on device and launchResult: Runs successfully, no crash
Expected Behavior
When running with .NET 10, the app should:
- Load the FaceTec native library successfully
- Decrypt and load DexGuard-protected classes from asset files at runtime
- Initialize without errors (as it does in .NET 9)
Actual Behavior
With .NET 10, the app crashes immediately on launch:
JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception
java.lang.ClassNotFoundException: Didn't find class "com.facetec.sdk.ipB21035"
on path: DexPathList[[zip file "/data/app/.../base.apk"],nativeLibraryDirectories=[...]]
at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean)
at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String)
at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.Class)
The class com.facetec.sdk.ipB21035 is an obfuscated class name that exists only as an encrypted asset, not in the APK's DEX files.
EDIT: File removed from being posted privately. If it is needed again, I can re-uplaod privately.
Did you find any workaround?
No. We attempted all standard configurations:
- ✅
IsTrimmable=false+TrimMode=copyin binding project - ✅
AndroidLinkMode=None(disabled linking completely) - ✅
AndroidEnableMultiDex=true - ✅
AndroidIncludeAllJavaLibraries=true - ✅ ProGuard/R8 keep rules for FaceTec classes
- ✅
LinkDescription.xmlto preserve assemblies
None of these configurations fixed the issue.
The only workaround is to stay on .NET 9.
Relevant log output
11-25 16:37:38.575 F/DEBUG (31893): Abort message: 'JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.ClassNotFoundException: Didn't find class "com.facetec.sdk.ipB21035" on path: DexPathList[[zip file "/data/app/~~pDs2zlceVA8osMf97aioIg==/com.appname-xJaTMS9iCm6pFTZctgYmgg==/base.apk"],nativeLibraryDirectories=[/data/app/~~pDs2zlceVA8osMf97aioIg==/com.appname-xJaTMS9iCm6pFTZctgYmgg==/lib/arm64, /data/app/~~pDs2zlceVA8osMf97aioIg==/com.appname-xJaTMS9iCm6pFTZctgYmgg==/base.apk!/lib/arm64-v8a, /system/lib64, /system_ext/lib64]]
11-25 16:37:38.575 F/DEBUG (31893): at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:259)
11-25 16:37:38.575 F/DEBUG (31893): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:637)
11-25 16:37:38.575 F/DEBUG (31893): at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:573)
11-25 16:37:38.575 F/DEBUG (31893): at java.lang.String java.lang.Runtime.nativeLoad(java.lang.String, java.lang.ClassLoader, java.lang.Class) (Runtime.java:-2)
Activity
jonathanpeppers commentedon Dec 1, 2025
When I read the description above, there is a lot of hallucinated information, such as:
These aren't "standard" in any way I'm aware of. Several of those MSBuild properties are completely made up!
If you run the repro:
REMOVED
Can you explain what file is missing/incorrect and what you expect to happen instead?
That summarization would help us a lot, thanks!
seth-govalidate commentedon Dec 1, 2025
My apologies @jonathanpeppers!
It crashes with the reported stack trace above:
net9.0-androidinsteadIt successfully runs the demo app without crashing.
Changing nothing else except targeting net10, the same code consuming a binding no longer works.
seth-govalidate commentedon Dec 8, 2025
@jonathanpeppers can you delete the file in your response? I didn't realize posting the SDK was against Facetec's ToS.
joagyl commentedon Dec 19, 2025
I can confirm this with Adyens Android SDK as well. After upgrading to .net 10 app crashes at startup.
Snippet from logcat output:
D/nativeloader( 7187): Load /data/app/~~HUCM2u25jeupesYjVvKajw==/eu.adyentest-CQpigdLc_zN6sAOot8tGVQ==/lib/arm64/libeef0.so using class loader ns clns-9 (caller=/data/app/~~HUCM2u25jeupesYjVvKajw==/eu.adyentest-CQpigdLc_zN6sAOot8tGVQ==/base.apk!classes3.dex): ok 12-18 15:18:03.159 F/enode.adyentest( 7187): java_vm_ext.cc:616] JNI DETECTED ERROR IN APPLICATION: JNI RegisterNatives called with pending exception java.lang.ClassNotFoundException: Didn't find class "atd.az.ChallengeResultErrorA27340" on path: DexPathList[[zip file "/data/app/~~HUCM2u25jeupesYjVvKajw==/eu.adyentest-CQpigdLc_zN6sAOot8tGVQ==/base.apk"],nativeLibraryDirectories=[/data/app/ ~~HUCM2u25jeupesYjVvKajw==/eu.adyentest-CQpigdLc_zN6sAOot8tGVQ==/lib/arm64, /data/app/~~HUCM2u25jeupesYjVvKajw==/eu.adyentest-CQpigdLc_zN6sAOot8tGVQ==/base.apk!/lib/arm64-v8a, /system/ lib64, /system_ext/lib64]]seth-govalidate commentedon Jan 8, 2026
@jonathanpeppers just checking in if there has been any progress on this issue?
jonathanpeppers commentedon Jan 8, 2026
Can you attach a repro project, or a
.binlogto understand what this library is doing? https://aka.ms/binlogFor all we know, they are relying on private MSBuild target ordering (and ordering changed in .NET 10). The supported extension points are documented at:
Anyone else, please upvote above if this is important to you, thanks!
seth-govalidate commentedon Jan 9, 2026
@jonathanpeppers Here is a binlog created using
dotnet build -f net10.0-android -c Debug -bl. I had previously uploaded a repro project but the SDK creator didn't want their SDK publicly listed (that's why I asked you to delete the file). Is there a way to privately upload the zip?msbuild.binlog.zip
15 remaining items
seth-govalidate commentedon Jan 13, 2026
Much appreciated, sent to both.
dationguyen commentedon Jan 16, 2026
Hi i got the same issue.
Any custom view class that are not register as (appid.classname) will be excluded.
I have many sub projects with different namespace.
Only 1 view that can show is the one that register as "appid.classname" ie "com.yourapp.android.prettyview".
dationguyen commentedon Jan 21, 2026
Hi @seth-govalidate , have u tried to switch to nuget reference instead? I found that when switch from project reference to nuget reference it back to work as intended
seth-govalidate commentedon Jan 22, 2026
@dationguyen The original bug was found using nuget reference (I publish the binding as a private nuget feed). The repro project uses project reference. So, no, it didn't make a difference for me.
bengt-GS commentedon Feb 6, 2026
The issue is not a bug in DexGuard, but incorrect native library loading behavior introduced by .NET 10.
By forcibly loading all native libraries a call to
RegisterNativesis done for a class that is not available yet. As shown by the samples Seth sent in an earlier comment on this thread, these libraries work fine with .NET 9, but fail with .NET 10.We reported this issue in #10617, but I failed to notice this issue had more traction.
patrickwinti commentedon Mar 3, 2026
Hi @jonathanpeppers and @grendello ,
we're having the exact same issue (also facetec) with a wrapper for native Android libraries and our .NET 10 upgrade is blocked therefore. Is there a plan / timeline to fix this in .NET 10? As .NET MAUI 9 will be out of support in May 2026, we cannot wait to .NET 11.
thanks and best regards
jonathanpeppers commentedon Mar 3, 2026
Is this issue related to native library-loading behavior?
I think some of the confusion here was this issue had an AI description that mostly mentioned DexGuard -- and not the underlying issue: native library loading.
If someone could confirm if the problem is addressed by the PR above, that would be great -- but we don't have a public build yet. I'll comment when we have one.
seth-govalidate commentedon Mar 3, 2026
Yeah, that's my bad. I didn't know what the issue was so I just went off what AI thought it was. I think #10617 did a better job at explaining the actual issue.
I'll gladly retest it once there's a public build and report back whether we had the same problem.
patrickwinti commentedon Mar 19, 2026
Hi @jonathanpeppers ,
thanks for your comment. Are there any news regarding a public / nightly build with the fix? I'd like to test if our issue is fixed with your backport merge. Or do you know when the fix will be available in an official release version?
jonathanpeppers commentedon Mar 19, 2026
Sorry, there are some instructions here:
patrickwinti commentedon Mar 19, 2026
perfect, thank you! I was able to run the application without the ClassNotFoundException.
Looking forward to a release with this fix so that we can proceed with the .net 10 upgrade.
patrickwinti commentedon Apr 22, 2026
fixed in .NET SDK 10.0.202. Thanks for all your help and fixes!
jonathanpeppers commentedon Apr 22, 2026
Thanks, I believe this is fixed in the latest release: