cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Axel Nennker <ignisvul...@gmail.com>
Subject Re: PluginManager.java regression cordova-3.2 ERROR: config.xml is missing. Add res/xml/config.xml to your project
Date Wed, 11 Dec 2013 20:01:50 GMT
I added a Log.d (code below) to PluginManager and get this output:
12-11 20:47:37.430: D/org.apache.cordova.PluginManager(25673):
this.ctx.getActivity().getClass().getPackage().getName()=de.telekom.tlabs.wallet.fileimport

This (de.telekom.tlabs.wallet.fileimport) is the package name of the
activity that was started by Android but this is not the applications main
activity's package which is "de.telekom.tlabs.wallet.cordova".
12-11 20:47:24.325: D/org.apache.cordova.PluginManager(25673):
this.ctx.getActivity().getClass().getPackage().getName()=de.telekom.tlabs.wallet.cordova

As you can see from the time stamps the second line is output earlier. This
is the output when the app starts normally. Then I open the Downloads
Android app and select a downloaded file that triggers "fileimport"'s
intent filter. Android now starts an activity in the package
"de.telekom.tlabs.wallet.fileimport" which then (re-)starts the main
activity in the package "de.telekom.tlabs.wallet.cordova" which leads to
the first output and the wrong package from beeing used to find config.xml

-axel

   /**
     * Load plugins from res/xml/config.xml
     */
    public void loadPlugins() {
      Log.d(this.getClass().getName(),
"this.ctx.getActivity().getClass().getPackage().getName()="+this.ctx.getActivity().getClass().getPackage().getName());
        int id =
this.ctx.getActivity().getResources().getIdentifier("config", "xml",
this.ctx.getActivity().getClass().getPackage().getName());
        if (id == 0) {



2013/12/11 Axel Nennker <ignisvulpis@gmail.com>

> Sorry no. It does not work on 3.3-rc1
> Axel
>
> ignisvulpis@ubuntu:/host/20131210/phonegap$ cordova -v
> 3.3.0-rc.1
> ignisvulpis@ubuntu:/host/20131210/phonegap$
>
> same error:
> D/CordovaActivity( 4871): CordovaActivity.init()
> D/CordovaWebView( 4871): >>>
> loadUrl(file:///android_asset/www/index.html?file=/storage/sdcard0/Download/WalletImport-InfoCard-MyCard2-1.json)
> D/PluginManager( 4871): init()
> E/PluginManager( 4871):
> =====================================================================================
> E/PluginManager( 4871): ERROR: config.xml is missing.  Add
> res/xml/config.xml to your project.
> E/PluginManager( 4871):
> https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;a=blob;f=framework/res/xml/config.xml
> E/PluginManager( 4871):
> =====================================================================================
> D/CordovaWebView( 4871): >>> loadUrlNow()
> D/ItemImport( 4871): onResume() loadURL started:
> D/CordovaActivity( 4871):
> onMessage(onPageStarted,file:///android_asset/www/index.html?file=/storage/sdcard0/Download/WalletImport-InfoCard-MyCard2-1.json)
>
>
>
>
> 2013/12/11 Andrew Grieve <agrieve@chromium.org>
>
>> If it worked in 3.1 and broke in 3.2, then it's very likely
>> CB-5481<https://issues.apache.org/jira/browse/CB-5481> and
>> is fixed in 3.3
>>
>>
>> On Wed, Dec 11, 2013 at 11:29 AM, Joe Bowser <bowserj@gmail.com> wrote:
>>
>> > No. As far as I'm concerned this problem doesn't exist until it is a
>> JIRA
>> > issue with some sample code that I can use to reproduce the error. I
>> doubt
>> > that this was a regression since we never explicitly supported your use
>> > case to begin with.
>> >
>> > Of course, patches are always welcome.
>> >  On 11 Dec 2013 07:58, "Axel Nennker" <ignisvulpis@gmail.com> wrote:
>> >
>> > > No. I intented this to be on the list. Gmail UI irks.
>> > > Could this be fixed in 3.3?
>> > > I know it is late but...
>> > >
>> > > -Axel
>> > >
>> > >
>> > > 2013/12/11 Joe Bowser <bowserj@gmail.com>
>> > >
>> > > > Did you mean to to send this to me personally?
>> > > >
>> > > > On Wed, Dec 11, 2013 at 7:24 AM, Axel Nennker <
>> ignisvulpis@gmail.com>
>> > > > wrote:
>> > > > > Well, this repeatable. Use 3.2 fail, go back to 3.1 win.
>> > > > > The config.xml is where it belongs but PluginManager does not
>> find it
>> > > in
>> > > > a
>> > > > > certain (legal) setting.
>> > > > > When the app is started "normally" PluginManager finds config.xml
>> > > (which
>> > > > > proves that is at the correct location)
>> > > > > When the app is started because an IntentFilter triggers then
>> > > > > PluginInManager does not find it.
>> > > > >
>> > > > > The "main" activity is in one class like a.b.c.Main while the
>> > > > IntentFilter
>> > > > > activity is in another e.g. u.v.w.IF
>> > > > > IF starts Main successfully but - my guess is - that PluginManager
>> > > tries
>> > > > to
>> > > > > find config.xml in package u.v.w
>> > > > >
>> > > > > The JUNIT/spec test should be updated to catch this situation
if
>> > > > possible.
>> > > > > I guess I could change the package names so that IF is in a.b.c
>> too
>> > but
>> > > > it
>> > > > > worked in 3.1 and I see no reason why this is "complex"
>> > > > > The u.v.w.IF features are implemented in a plugin that registers
>> the
>> > > > intent
>> > > > > filter in the app's AndroidManifest. It is developed by my
>> colleagues
>> > > who
>> > > > > chose the u.v.w package name. I am using this plugin in my app
>> that
>> > has
>> > > > the
>> > > > > a.b.c package namespace.
>> > > > > I do not agree that this a complex or irregular use of cordova
or
>> > > > Intents.
>> > > > >
>> > > > > Please revert the code back to the 3.1 behaviour.
>> > > > >
>> > > > > Axel
>> > > > >
>> > > > >
>> > > > > 2013/12/11 Joe Bowser <bowserj@gmail.com>
>> > > > >>
>> > > > >> I haven't noticed this during any of our testing, nor have
I
>> noticed
>> > > > >> this when hacking with Google Glass, which uses the Google
Glass
>> > voice
>> > > > >> trigger intent to launch Cordova, not the LAUNCHER intent
like
>> the
>> > > > >> launch menu.  Furthermore, our JUnit tests haven't caught
the
>> tests
>> > > > >> either, and they depend on at least three plugins to be loaded
by
>> > > > >> PluginManager from config.xml.  Honestly, this only breaks
if you
>> > > > >> don't know what you're doing with Intents.
>> > > > >>
>> > > > >> Honestly, It sounds to me like your config.xml isn't in the
>> correct
>> > > > >> place in your project, especially if you're trying to do
>> something
>> > > > >> complex with Android and intents.  I would check that making
>> these
>> > > > >> sorts of statements.  If config.xml wasn't being read, it
would
>> have
>> > > > >> been caught right away, since everything is a plugin now.
>> > > > >>
>> > > > >>
>> > > > >>
>> > > > >> On Wed, Dec 11, 2013 at 4:33 AM,  <Axel.Nennker@telekom.de>
>> wrote:
>> > > > >> > Hi,
>> > > > >> >
>> > > > >> > We are seeing some strange effect on Android when we
move from
>> > > > >> > 3.1.0-0.2.0 to a newer version.
>> > > > >> > We tried with 3.2.0-0.4.0 and 3.3-rc1
>> > > > >> >
>> > > > >> > I think that PluginManager changed and now fails to
load
>> > config.xml
>> > > > >> >
>> > > > >> > This happens in my project when the app is opened by
the
>> operating
>> > > > >> > system because it is configured so through an intent
filter.
>> > > > >> > The original activity is not a child of DroidGap but
starts the
>> > > "main"
>> > > > >> > activity using startActivity.
>> > > > >> >
>> > > > >> > The code to get the id of the config.xml file is not
working in
>> > this
>> > > > >> > case.
>> > > > >> >
>> > > > >> > Why was the 3.1.0 code changed?
>> > > > >> >
>> > > > >> > Cheers
>> > > > >> > Axel
>> > > > >> >
>> > > > >> > D/CordovaActivity(12320): CordovaActivity.init()
>> > > > >> > D/CordovaWebView(12320): >>>
>> > > > >> >
>> > > >
>> > >
>> >
>> loadUrl(file:///android_asset/www/index.html?file=/storage/sdcard0/Download/WalletImport-InfoCard-PremiumBank2-2.json)
>> > > > >> > D/PluginManager(12320): init()
>> > > > >> > E/PluginManager(12320):
>> > > > >> >
>> > > >
>> > >
>> >
>> =====================================================================================
>> > > > >> > E/PluginManager(12320): ERROR: config.xml is missing.
 Add
>> > > > >> > res/xml/config.xml to your project.
>> > > > >> > E/PluginManager(12320):
>> > > > >> >
>> > > >
>> > >
>> >
>> https://git-wip-us.apache.org/repos/asf?p=incubator-cordova-android.git;a=blob;f=framework/res/xml/plugins.xml
>> > > > >> > E/PluginManager(12320):
>> > > > >> >
>> > > >
>> > >
>> >
>> =====================================================================================
>> > > > >> > D/CordovaWebView(12320): >>> loadUrlNow()
>> > > > >> > D/ItemImport(12320): onResume() loadURL started:
>> > > > >
>> > > > >
>> > > >
>> > >
>> >
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message