question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

resource raw/my_ca not found

See original GitHub issue

Description

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:closed
  • Created a year ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Redthcommented, Oct 18, 2022

Closing as the answer is up in the thread about placing the files in the correct location (thanks!)

0reactions
GalaxiaGuycommented, Oct 15, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android raw resource can't be found
This code throws a resource not found exception and in the logs it says "resources don't contain package for resource number 0x7f04000".
Read more >
Resource not found errors - Azure Resource Manager
Resolve errors for resource not found · In this article · Symptoms · Cause · Solution 1: Check resource properties · Solution 2:...
Read more >
Resource not found edit
Hi, I am working within a simple ROS workspace where I have two packages. I have included in my workspace (as a new...
Read more >
Meet Rubin Singer, the Jewish Designer Behind Beyonce's ...
Meet Rubin Singer, the Jewish Designer Behind Beyonce's Super Bowl Outfit ... If you're part of the American Super Bowl-viewing public—or have a ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found