agamemnus / cordova-plugin-xapkreader

Easily access Google Play APK expansion file data.
32 stars 55 forks source link

Downloading Assets bug #121

Closed HintOfLemon closed 6 years ago

HintOfLemon commented 6 years ago

Hi there!

I know this is pretty much the exact same error that was posted over here

but the issue I'm having is slightly different. The resolution to that error was that the public key was being defined in multiple places, such as the plugins folder.

I am relying entirely on my config.xml to install and configure the app, namely:

<plugin name="com.flyingsoftgames.xapkeader" spec="https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0"> <variable name="XAPK_EXPANSION_AUTHORITY" value="com.appname" /> <variable name="XAPK_PUBLIC_KEY" value="key"/> </plugin>

As I'm using Phonegap Build, which doesn't let me access or modify any files in the plugins or platform directories.

As the application opens, it shows a dialog with "Downloading Assets 0/100". The app opens correctly and what seems like a background process continues running with a download showing -0.00mb/-0.00mb download.

It doesn't seem to be accessing the expansion files correctly, and I think it may be because of this.

agamemnus commented 6 years ago

In Cordova, the plugin's config.xml is used IIRC to add com.flyingsoftgames.xapkreader to platforms/android/ and seed platforms/android/AndroidManifest.xml, platforms/android/android.json, and platforms/android/project. So you need to tell it somehow to do this.

HintOfLemon commented 6 years ago

Thanks for the very quick reply!

So, if I understand what you're saying, I need a way to modify the plugin's config.xml? Since that's what modifies all the other files?

agamemnus commented 6 years ago

Well, hold on a second, what are you doing to install it? The installation should set everything up if you add the expansion authority and public key in the command line.

HintOfLemon commented 6 years ago

Ok, so the previous developer of this app went with Phonegap Build, which is an online service which allows you to upload the files that would normally be contained only within the www folder of a Cordova app, and it builds and compiles it into a downloadable apk in one go.

This means the only real files I have that I'm able to modify are all the www files and a config.xml file, where I can specify the plugins I want installed and Phonegap Build adds them for me during the compilation process. This means I can't add anything via cli, the only control I have is via that config.xml file.

agamemnus commented 6 years ago

I have used Phonegap Build before, just don't remember the details. Is there some way you can clear the build and have it rebuild or something?

You might want to look into reworking it with ionic.

HintOfLemon commented 6 years ago

Ok cool, I'll maybe try that, and just to be sure, since I've read different things all over the place, to access the expansion files, is it: content://com.appname/location/img.png? [<--- It's this one] or [REDACTED]

agamemnus commented 6 years ago

It's content://[XAPK_EXPANSION_AUTHORITY]/location/img.png, so in your case it would be content://com.appname/location/img.png.

HintOfLemon commented 6 years ago

Ok, so eventually I figured out that the problem was caused because of the Cordova version. By upgrading from 6.2.0 -> 6.5.0 everything seems to be working fine.

Thanks again for the help and clarification.

agamemnus commented 6 years ago

Great. :)

On Wed, Apr 4, 2018, 2:47 AM Marc Cilliers notifications@github.com wrote:

Ok, so eventually I figured out that the problem was caused because of the Cordova version. By upgrading from 6.2.0 -> 6.5.0 everything seems to be working fine.

Thanks again for the help and clarification.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/agamemnus/cordova-plugin-xapkreader/issues/121#issuecomment-378497870, or mute the thread https://github.com/notifications/unsubscribe-auth/ADFJWK8a8GcFRzaTupnXYrd2pp3terMwks5tlGxtgaJpZM4TC5G4 .