cordova-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Håkon Nilsen (JIRA) <j...@apache.org>
Subject [jira] [Commented] (CB-5080) When you build an app using aapt's --rename-manifest-package argument, it searches for all of the resources in the wrong location
Date Wed, 04 Dec 2013 16:37:35 GMT

    [ https://issues.apache.org/jira/browse/CB-5080?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839052#comment-13839052
] 

Håkon Nilsen commented on CB-5080:
----------------------------------

This pull request will not work for multi-app setups (like Gradle with appending namespace
in AndroidManifest.xml). Apps using flavors with different namespaces will never work with
this.

Our activity class does not live in the same namespace as the AndroidManifest.xml states.

Example:
   no.spv.mobilbank <-- class namespace
   no.spv.mobilbank.testapp <-- AndroidManifest.xml namespace (which is where the config.xml
will be when the app is packaged)

I suggest either reverting this pull request or create a fallback. I.e.:
int id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getClass().getPackage().getName());
if (id == 0) {
   id = this.ctx.getActivity().getResources().getIdentifier("config", "xml", this.ctx.getActivity().getPackageName());
   if (id == 0) {
       this.pluginConfigurationMissing();
...

This will work for both cases, but it's a bit messy.

aapt docs might be of help:
http://www.piwai.info/renaming-android-manifest-package/

They suggest having a resource that's only there to get the packagename. It's also kinda messy,
but it will work.

I think Cordova should support the way Gradle and Android in itself handles packages in AndroidManifest.xml.

(and to be clear, this wasn't working for us before using Gradle either, we have been using
AndroidManifest.xml packagename this way for ages)

> When you build an app using aapt's --rename-manifest-package argument, it searches for
all of the resources in the wrong location
> ---------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-5080
>                 URL: https://issues.apache.org/jira/browse/CB-5080
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>            Reporter: Andrew Grieve
>            Assignee: Andrew Grieve
>            Priority: Minor
>             Fix For: 3.2.0
>
>
> From pull request: https://github.com/apache/cordova-android/pull/62



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message