distriqt / ANE-CustomResources

Android Custom Resources for AIR Applications
https://airnativeextensions.com
15 stars 4 forks source link

Trouble when building APK: invalid resource directory name #21

Closed chichilatte closed 6 years ago

chichilatte commented 6 years ago

Hi

I can build this ANE using ant (changing only the build_config/build.config air.sdk and android.sdk values and adding the res/values.xml), but running a super simple test build of an apk (using the command line) gives me the error...

An implementation for native extension 'com.distriqt.extension.customresources.Resources' required by the application was not found for the target platform

In plain English: it couldn't find the ANE.

The ANE file is named com.distriqt.extension.customresources.Resources.ane and in my applicationDescriptor.xml I have the line... <extensionID>com.distriqt.extension.customresources.Resources</extensionID>


I had a look inside the ANE and saw that its id is actually com.distriqt.CustomResources (found in META-INF/ANE/extension.xml). So I change the applicationDescriptor line to... <extensionID>com.distriqt.CustomResources</extensionID>

And this time the apk build gives me the error... aapt tool failed:invalid resource directory name: /private/var/folders/kj/00jc9ntj3dj1j2jd5lkrs9vw0000gn/T/81455ed5-b745-47da-b5e4-e32411fcde61/customresources values.xml


Since we're actually using Distriqt's Firebase ANE in our project, I made a third attempt, this time changing the build_config/build.config android.package to co.playlingo.wordable.extensions.customresources (as recommended on another issue) but we got the same problems as above.


Here's my res/values.xml file (redacted)...

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <string name="google_app_id" translatable="false">xxxx</string>
    <string name="gcm_defaultSenderId" translatable="false">xxxx</string>
    <string name="google_api_key" translatable="false">xxxx</string>
    <string name="google_crash_reporting_api_key" translatable="false">xxxx</string>
    <string name="default_web_client_id" translatable="false">xxxx</string>
    <string name="firebase_database_url" translatable="false">xxxx</string>
    <string name="ga_trackingId" translatable="false">xxxx</string>
</resources>

And using...

Any help much appreciated thanks.

marchbold commented 6 years ago

You must name the directories in your res directory as per the Android specification.

The values.xml should be placed in a values directory, ie. res/values/values.xml

chichilatte commented 6 years ago

Argh, really dumb, thank you that worked!

For anyone wanting to know where the correct path is mentioned... https://distriqt.github.io/ANE-Firebase/Setup%20-%20Configuration%20Files

marchbold commented 6 years ago

Excellent,

What would have helped you with this process? Should we include an example Firebase config file in this repository?

chichilatte commented 6 years ago

Hi, sorry, never saw your reply. Yep i think an example config file in the right place would be perfect :)

marchbold commented 6 years ago

Yeah great, we will add this into the docs.

Cheers