resource raw/my_ca not found
See original GitHub issueDescription
I’m trying to setup a .net maui android platform to allow private CA certificate as described at https://developer.android.com/training/articles/security-config, it ask me to put my CA certificate at
res/raw/my_ca
In my project I do that at MyAppFolder\Platfroms\Android\Resources\raw\my_ca and leave ther my .pem CA certificate, but whene I try to deploy to my android test phone it shows me:
APT2260 resource raw/my_ca (aka com.companyname.paradigman.apps.controln:raw/my_ca) not found. ParadigmaN.Apps.ControlN D:\Proyectos\Proyectos.Net\ParadigmaN!\ParadigmaN\ParadigmaN.Apps.ControlN\Resources\xml\network_security_config.xml 2
I added same file at MyAppFolder\Resources\Raw
Steps to Reproduce
1 Create .net maui application
2 Add folder raw at Platforms\Android\Resources
3 Add folder my_ca at Platforms\Android\Resources\raw
3 Add folder xml at Platforms\Android\Resources
4 Add network_security_config.xml file to folder at step 3 with this content <?xml version="1.0" encoding="utf-8"?> <network-security-config> <domain-config cleartextTrafficPermitted="false"> <trust-anchors> <certificates src="@raw/my_ca"/> </trust-anchors> </domain-config> </network-security-config>
5 Add a .pem file to Platforms\Android\Resources\raw\my_ca
Try to deply to an android device
Link to public reproduction project repository
https://github.com/jupagose/mauibug_trusted_roots
Version with bug
6.0.400
Last version that worked well
Unknown/Other
Affected platforms
Android
Affected platform versions
Android 12
Did you find any workaround?
NO
Relevant log output
Build started...
1>------ Build started: Project: ParadigmaN.Apps.ControlN, Configuration: Debug Any CPU ------
1>Resources\xml\network_security_config.xml(2): error APT2260: resource raw/my_ca (aka com.companyname.paradigman.apps.controln:raw/my_ca) not found.
1>C:\Program Files\dotnet\packs\Microsoft.Android.Sdk.Windows\32.0.448\tools\Xamarin.Android.Aapt2.targets(156,3): error APT2061: failed linking file resources.
1>Done building project "ParadigmaN.Apps.ControlN.csproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)

Top Related StackOverflow Question
Closing as the answer is up in the thread about placing the files in the correct location (thanks!)
I believe in the case of multiple certificates, they should all be in one file. For PEM format, it looks like you just concatenate them:
https://stackoverflow.com/questions/36043272/can-i-combine-multiple-certs-into-one-without-the-private-key