Giter VIP home page Giter VIP logo

cordova-plugin-xapkreader's Introduction

NOTICE: At present, the master branch is only a text file.

As of the time of this writing, the current version is 6.5, and setup is relatively straightforward: cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 --variable XAPK_EXPANSION_AUTHORITY="expansion_authority" --variable XAPK_PUBLIC_KEY="YOUR_GOOGLE_PLAY_LICENSE_KEY" or cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-6.5.0 (if you want to add those variables later). This should work for Cordova 5.3.1 through 6.5.0.

There is also a Cordova 5.0 version (because of the somewhat difficult bugs with it, it's not trivial to set it up correctly): cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader#cordova-5.0.

If you need a Cordova pre-gradle version (which is I think Cordova 3.6?), use the pre-gradle branch: cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader#pre-gradle.

cordova-plugin-xapkreader's People

Contributors

agamemnus avatar shaungreiner avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cordova-plugin-xapkreader's Issues

Copy File from obb to fileSystem

Hy,

I have to copy video and audio files from inside the obb-File to the File-System. Otherwise Android 4.4.4 can't play videos / audio files.

How can I access a single file in obb-File and copy it to a folder in Filesystem?

meta http-equiv="Content-Security-Policy" gives me an error

On your README you list the following as one of the options to get "content://" working:

When I view the console I receive the following error:
"Unrecognized Content-Security-Policy directive '*'."

This does not seem to harm the plugin in anyway. This is more like "just to let you know".

Install problem

When I install plugin I have empty android

I don't have added any plugins parameters.

Where problem?
android.txt

Version Problem

Hello Dear,

Many people have problems with Cordova version. This plugin support version 5-3-1, for now Cordova version is 6++. Please valued dear update this plugin. :-D

Sincerely,
Pheng Sengvuthy

Payment terms

I would be happy to pay you for this code once I get it working. But the link you give is for a weekly amount, and there's no way to pay for one lump sum. Why not use the popular PayPal service?

Problem with source of <video> on Android

Hi there,

I have a project where I use many videos. So I have to outsource them to an expansion pack.
The normal uri for my videos are /android_assets/www/folder/video.mp4

Like in the tutorial https://iphonedevlog.wordpress.com/2014/12/12/adding-an-android-apk-expansion-file-to-a-cordova-project/ for images the uri content://de.examle.app/main_expansion/folder/image.jpg works perfectly.
But for videos the uri content://de.examle.app/main_expansion/folder/video.mp4 doesn't work. Has anybody an idea what is the solution of my problem?

Thank you for any advice!

Phone gap Build

Is this compatible with the phonegap build server? When i add the xapkreader to the config file it can no longer build, The errors from the build server do not go into any detail. Has anyone else used this with phonegap build server?

Loading assets stuck at 0% / 100% after patch

When I upload a patch the asset loader is unable to load the expansion file. It's just stuck at 0 / 100% and doesn't move.

It doesn't matter if I re-use the same expansion file or upload a new one. Same thing happens.

The app still works, you just gotta hit the back button and relaunch the app after the patch.

Are there any fixes for this?

Unable to read files from within OBB file

When I try to read an image with the following pathing "content://my.cordova.project/assets/images/Example.png", I receive a 404 upon inspecting during launch.

I placed my obb file in Phone\Android\obb\my.cordova.project\main.0001.my.cordova.project.obb. The obb file itself is a simple, 0 compression zip containing assets I wish to load. Inside the obb file is a single folder called Assets, which then leads to images, music, etc.

I saw that there was an issue alike this one, but most of the fixing went via private messaging, so I'm unaware of the solution, still.

Download success, but content not visible until there's a restart.

First off, thanks for putting this together! It's the first plugin for this that seems workable to me. I found out about this from a blog post (http://iphonedevlog.wordpress.com/2014/12/12/adding-an-android-apk-expansion-file-to-a-cordova-project/), and I've been working to see if I can get the downloading to work properly. I've also posted to the Google Groups for Phonegap about this, so I'll re-post my question from there:

Okay, I've been playing around with this plugin some more and the re-downloading code does actually work. The issue is in the XAPKReader.reloadExpansionFile function. The try block will crash the app. If it's commented out (and you've set the metadata for your main and patch file versions and filesizes), it will properly do the download of the needed expansion files (I tested with deleting just the main, just the patch, and both) and they all re-download. The issue is that the plugin asynchronously calls the downloader activity then immediately allows the cordova webview to load, so if the expansion files do need to be downloaded/re-downloaded, your webview has already loaded and doesn't know that the expansion files are now there. Depending on which files were still on your device, the app may look like it doesn't have any expansion files or only has the main file. You have to shut down the app, and restart it again before it will show files from the expansion files.

I'm not a Java expert, but I figure a RunnableFuture or a FutureTask would enable the plugin to block and wait for confirmation that the expansion files are available before allowing the cordova webview to proceed. Any Android/Java experts able to lend a hand with the code? If the Runnable could be changed to wait for completion before running the super.initialize line, I think it might be enough.

Code below (from the XAPKReader.java file in the initialize function):

  cordova.getActivity().runOnUiThread (new Runnable() {
   @Override public void run () {
    Context context = cordova.getActivity().getApplicationContext();
    Intent intent = new Intent(context, XAPKDownloaderActivity.class);
    intent.putExtras (bundle);
    cordova.getActivity().startActivity (intent);
   }
  });

  super.initialize (cordova, webView);

Alternatively, does anyone know how to force the cordova webview to restart from the top?

Set iframe src to content:// url failing silently

Hi,
I really appreciate this plugin -- it's made my life a lot easier! I do have one question/potential issue.

We have set up a simple app, and the premise works great -- we can load images from the expansion pack, etc.

However, one of the key things we are trying to do is set an iframe's src to an html file that is in the expansion pack, and this is failing silently. Our initial assumption was that this was some type of security restriction, but we followed the instructions in the readme at https://github.com/agamemnus/cordova-plugin-xapkreader/blob/cordova-5.3.1/README.md. We are using your whitelist plugin.

We are setting the iframe's src using simple javascript: $("iframe")[0].src = "content://com.cloudkid.expansion/main_expansion/(path)/index.html".

We aren't seeing any output in any log, either using adb logcat or inspecting it via Chrome.

We have also tried with and without the crosswalk plugin, and it makes no difference.

We can get the contents of the html file in the expansion pack using jQuery.get("content://(path)/index.html") and verify that the html file exists.

Is this a known issue? We can create a simple version of our app with non-proprietary content if that would help diagnose things. Please let me know if you need more details. Thanks!

android.json

Hi, I can't find those values in android.json any more

com.test.expansionandYOUR_GOOGLE_PLAY_LICENSE_KEY

should I insert them in plugin.xml ?

Permission denied

Hi,
I have a permission problem accessing the obb after the upload on the playstore. I followed the instructions from here -> https://github.com/agamemnus/cordova-plugin-xapkreader/blob/gh-pages/test-project-instructions-and-test-obb/instructions.txt

  • I'm using android cordova version 3.7.1.
  • Obb filename (name is set automatically from the playstore) -> main.10000.it.companyname.appname.obb
  • Obb structure example -> expansion/audio/file.mp3
  • Example of file access -> content://it.companyname.appname/expansion/audio/file.mp3
  • In android.json -> "xml": "<string name="xapk_expansion_authority">it.companyname.appname", (and the relative xapk_google_play_public_key)
  • In project.properties -> android.library.reference.2=../../plugins/com.flyingsoftgames.xapkreader/android-sdk/extras/google/play_apk_expansion/downloader_library

In console log i have this result:

W/ActivityManager( 405): Permission denied: checkComponentPermission() owningUi d=10075 W/ActivityManager( 405): Permission denied: checkComponentPermission() owningUi d=10075 D/ ( 119): openContentUri(content://it.companyname.appname/expansion/ audio/file.mp3) caught exception -1 E/MediaPlayerService( 119): Couldn't open fd for content://it.companyname.appname/expansion/audio/file.mp3 E/MediaPlayer( 4071): Unable to to create media player E/HTML5Audio( 4071): couldn't load the resource: content://it.companyname.appname/expansion/audio/file.mp3 exc: java.io.IOException: setDataSource failed.: status=0x80000000 W/ActivityManager( 405): Permission Denial: opening provider com.flyingsoftgame s.xapkreader.XAPKProvider from (null) (pid=119, uid=1013) that is not exported from uid 10075 I/libuTorrent-jni( 1580): Array with 1 files returned.

Where could be the problem ?

Thanks in advance,
Marco

Still can't solve library project name issue

I sent a paypal donation =)

I read through all the posts on #22 and still don't quite understand how to fix this. Where project name is 'explore' I see the directory 'explore-library' next to the downloader library folder. Sorry, I don't understand gradle at all...

Project with path ':com.flyingsoftgames.xapkreader:explore-library' could not be found in project ':com.flyingsoftgames.xapkreader:downloader_library'.

I tried downgrading to cordova [email protected] and with 6.1.1, both have the same error.

I tried going up a level:

dependencies {
    debugCompile project(path: '..:com.flyingsoftgames.xapkreader:explore-library',configuration: "debug")
    releaseCompile project(path: '..:com.flyingsoftgames.xapkreader:explore-library',configuration: "release")
}

Should the default branch be 5.3.1?

I am concerned that users of the older version will try to reinstall via the update, and then break their build hard.

On the other hand, I would like to encourage users to use the 5.3.1 version.

I am thinking that maybe I should make the default branch be just a readme, so that it is only an inconvenience for users reinstalling.

_Maybe there is a way to detect the Cordova version and branch appropriately?_

Thoughts on this?

XAPKDownloaderActivity xmlData (from bundle) throw error.

Hi,

In the XAPKDownloaderActivity class on line 54, we have the method
@Override public void onCreate (Bundle savedInstanceState)

The savedInstanceState is not an extra bundle from intent created in the XAPKReader class.

is the

cordova.getActivity().runOnUiThread (new Runnable() {
   @Override public void run () {
    Context context = cordova.getActivity().getApplicationContext();
    Intent intent = new Intent(context, XAPKDownloaderActivity.class);
    intent.putExtras (bundle); //the bundle is in extra of the intent
    cordova.getActivity().startActivity (intent);
   }
  });

I am not a java dev, but after some search, i found that to get an intent from an activity we have to do that in the XAPKDownloaderActivity in the onCreate method:

@Override public void onCreate (Bundle savedInstanceState){
  super.onCreate (savedInstanceState);
  //old code xmlData = savedInstanceState;
  xmlData = getIntent().getExtras();
  [...]
}

Then we will be able to get string form the intent.
In my case, the savedInstanceState or the xmlData was always an empty bundle.

Could you confirm me this ? i do not know why he is empty as i am the only one to report this issue

cordova-plugin-xapkreader & gradle (Cordova 5.0.0) error

Hi, after updating my project to cordova 5.0.0 i get this error if i run "cordova build android":

_expansion:downloader_library:compileDebugJavaD:\Dropbox\Documenti\App\actmindfu
lly\plugins\com.flyingsoftgames.xapkreader\android-sdk\extras\google\play_apk_ex
pansion\downloader_library\src\com\google\android\vending\expansion\downloader\i
mpl\DownloaderService.java:26: error: package com.google.android.vending.licensi
ng does not exist
import com.google.android.vending.licensing.AESObfuscator;
^
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:27: error: package
com.google.android.vending.licensing does not exist
import com.google.android.vending.licensing.APKExpansionPolicy;
^
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:28: error: package
com.google.android.vending.licensing does not exist
import com.google.android.vending.licensing.LicenseChecker;
^
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:29: error: package
com.google.android.vending.licensing does not exist
import com.google.android.vending.licensing.LicenseCheckerCallback;
^
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:30: error: package
com.google.android.vending.licensing does not exist
import com.google.android.vending.licensing.Policy;
^
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:756: error: cannot
find symbol
final APKExpansionPolicy aep = new APKExpansionPolicy(mContext,
^
symbol: class APKExpansionPolicy
location: class DownloaderService.LVLRunnable
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:756: error: cannot
find symbol
final APKExpansionPolicy aep = new APKExpansionPolicy(mContext,
^
symbol: class APKExpansionPolicy
location: class DownloaderService.LVLRunnable
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:757: error: cannot
find symbol
new AESObfuscator(getSALT(), mContext.getPackageName(), devi
ceId));
^
symbol: class AESObfuscator
location: class DownloaderService.LVLRunnable
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:765: error: cannot
find symbol
final LicenseChecker checker = new LicenseChecker(mContext, aep,
^
symbol: class LicenseChecker
location: class DownloaderService.LVLRunnable
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:765: error: cannot
find symbol
final LicenseChecker checker = new LicenseChecker(mContext, aep,
^
symbol: class LicenseChecker
location: class DownloaderService.LVLRunnable
D:\Dropbox\Documenti\App\xxxxx\plugins\com.flyingsoftgames.xapkreader\and
roid-sdk\extras\google\play_apk_expansion\downloader_library\src\com\google\andr
oid\vending\expansion\downloader\impl\DownloaderService.java:768: error: cannot
find symbol
checker.checkAccess(new LicenseCheckerCallback() {
^
symbol: class LicenseCheckerCallback
location: class DownloaderService.LVLRunnable
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
11 errors
FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':..:..:plugins:com.flyingsoftgames.xAPKreader:android
    -sdk:extras:google:play_APK_expansion:downloader_library:compileDebugJava'.

    Compilation failed; see the compiler error output for details.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info
    or --debug option to get more log output.
    BUILD FAILED

Total time: 2.87 secs

D:\Dropbox\Documenti\App\xxxxx\platforms\android\cordova\node_modules\q\q
.js:126
throw e;
^
Error code 1 for command: cmd with args: /s /c "D:\Dropbox\Documenti\App\xxxxx
\platforms\android\gradlew cdvBuildDebug -b D:\Dropbox\Documenti\App\xxxxx
\platforms\android\build.gradle -Dorg.gradle.daemon=true"
ERROR building one of the platforms: Error: D:\Dropbox\Documenti\App\xxxxx
\platforms\android\cordova\build.bat: Command failed with exit code 8
You may not have the required environment or OS to build this project
Error: D:\Dropbox\Documenti\App\xxxxx\platforms\android\cordova\build.bat
: Command failed with exit code 8
at ChildProcess.whenDone (C:\Users\Marco\AppData\Roaming\npm\node_modules\co
rdova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:766:16)
at Process.ChildProcess._handle.onexit (child_process.js:833:5)

D:\Dropbox\Documenti\App\xxxxx>ant debug install -Dout.dir=ant-build -Dge
n.absolute.dir=ant-gen
Buildfile: build.xml does not exist!
Build failed

Build failed with exception afterinstalling cordova-plugin-xapkreader5.3.1

D:\hell>cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.example.hell
Name: Hell
Activity: MainActivity
Android target: android-23
Android project created with [email protected]
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Fetching plugin "cordova-plugin-whitelist@1" via npm
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do not need this plugin since the whitelist will be built in.
D:\hell>cordova platform add android
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: com.example.hell
Name: Hell
Activity: MainActivity
Android target: android-23
Android project created with [email protected]
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do not need this plugin since the whitelist will be built in.
D:\hell>cd platforms
D:\hell\platforms>cd android
D:\hell\platforms\android>cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader#cordova-5.3.1
Fetching plugin "https://github.com/agamemnus/cordova-plugin-xapkreader" via git
clone
Repository "https://github.com/agamemnus/cordova-plugin-xapkreader" checked out
to git ref "cordova-5.3.1".
Installing "com.flyingsoftgames.xapkreader" for android
Notice: com.google.play.services has been automatically converted to cordova-google-play-services and fetched from npm. This is due to our old plugins registry shutting down.
Fetching plugin "cordova-google-play-services" via npm
Installing "cordova-google-play-services" for android
See the README.md file to complete your installation.
D:\hell\platforms\android>cordova build android
ANDROID_HOME=C:\Users\Ruben\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_31
Incremental java compilation is an incubating feature.
FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\hell\platforms\android\com.flyingsoftgames.xapkreader\hell-downloader_library\build-extras.gradle' line: 2

  • What went wrong:
    A problem occurred evaluating script.

    Project with path ':com.flyingsoftgames.xapkreader:hell-library' could not be found in project ':com.flyingsoftgames.xapkreader:downloader_library'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.604 secs
Error: cmd: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

  • Where:
    Script 'D:\hell\platforms\android\com.flyingsoftgames.xapkreader\hell-downloader
    _library\build-extras.gradle' line: 2

  • What went wrong:
    A problem occurred evaluating script.

    Project with path ':com.flyingsoftgames.xapkreader:hell-library' could not be found in project ':com.flyingsoftgames.xapkreader:downloader_library'.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

XAPK_PUBLIC_KEY

When install plugin I got this: (created platform with cordova platform add [email protected])

Failed to install 'com.flyingsoftgames.xapkreader':Error: Variable(s) missing: XAPK_PUBLIC_KEY
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:362:23
at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:749:13)
at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:557:44
at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17)
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
Error: Variable(s) missing: XAPK_PUBLIC_KEY

Documentation

Hi,

I can not run the plugin properly. Where can I find a step-by-step integration?

Thanks

Improved configuration options

Hi! Thanks for your hard work on this plugin.

I was thinking it would be nice if this plugin could be configured more easily and in a more automated way.

This plugin, which is doing something similar to yours, can be configured at install like this:

cordova plugin add com.intel.xapkreader --variable MAIN_VERSION=1 --variable MAIN_FILESIZE=12345 --variable PATCH_VERSION=0 --variable PATCH_FILESIZE=0 --variable YOUR_PUBLICKEY="your own application publickkey" --variable DOWNLOAD_OPTION=true

I like this because I don't have to dig around in platform build files. I like being able to clean and rebuild the platforms directory easily.

I think better yet would being able to configure the plugin via the cordova projects config.xml like:

<widget>
    ....
    <plugin name="cordova-plugin-xapkreader" version="2.3.4"/>
    <preference name="xapk_application_public_key" value="BLAH BLAH BLAH"/>
    <preference name="xapk_main_version" value="4"/>
</widget>

I think this is the direction cordova is going with the 5.0.0+ releases.

Crash when trying to DL the expansion file on a beta release

I started the app and got the message "Downloading assets..." after which the app crashed immeadiately.

This is the error message from google play's crash page:

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sound.moodil/com.flyingsoftgames.xapkreader.XAPKDownloaderActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2356)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2418)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5289)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.Window android.app.Activity.getWindow()' on a null object reference
at com.flyingsoftgames.xapkreader.XAPKDownloaderActivity.onCreate(XAPKDownloaderActivity.java:75)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2309)
... 10 more

org.apache.http

Error compiling ...why ?

Error:(20, 23) error: package org.apache.http does not exist
Error:(21, 36) error: package org.apache.http.client.utils does not exist
Error:(382, 18) error: cannot find symbol class NameValuePair
Error:(382, 45) error: cannot find symbol variable URLEncodedUtils
Error:(383, 18) error: cannot find symbol class NameValuePair

content not ready immediately after download on Android 6

We are using this plugin in our Ionic project to load assets from an expansion obb file.
In Android 6 contents are not immediatly available after the download process and requiring a resource with content://package/main_expansion/img/image.png gives a 404
in logcat: AndroidProtocolHandler: Unable to open content URL: content://package/main_expansion/img/image.png
It works fine if we wait some time before requiring image.png (or closing and starting again the application)

Error in Eclipse after integrate the plugin

First, thanks a lot for the job ! :)

I want to integrate this plugin because my app size 250 Mo.
So i followed the installation procedure but errors persist in Eclipse :

02-08-2016 17-47-33

02-08-2016 17-50-31

Cordova version : 5.4.1

Opening other type of files

Hi I have everything working, and can use most of the files in the obb file.
My obb file contains a lot of other type of documents .doc .xls etc.
I need to be able to open these files in some way and for the life of me could not figure out. I tried to just link to them but this did not work.

So I thought maybe I should copy the files out of the obb file to the sdcard and then I can view these documents, but I can't get the copy to happen. Maybe not the right way but thought I would just try.

Here is the code I used

function onDeviceReadyMe() {
    window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onFileSystemSuccess, fail);
    window.resolveLocalFileSystemURL("content://za.co.anomalous.cfourk/main_expansion/5/uploads/booklets/O2.doc", 
            function(entry) 
    {
        window.resolveLocalFileSystemURL("file:///sdcard/", 
        function(destination) {
             entry.copyTo(destination,"O2.doc",success,fail);
        })
    });
}

But I keep getting these errors

02-03 12:43:35.280: D/dalvikvm(24792): GC_CONCURRENT freed 7575K, 22% free 30285K/38599K, paused 3ms+102ms
02-03 12:43:35.490: W/System.err(24792): java.io.FileNotFoundException
02-03 12:43:35.490: W/System.err(24792): at com.flyingsoftgames.xapkreader.XAPKProvider.openAssetFile(XAPKProvider.java:115)
02-03 12:43:35.500: W/System.err(24792): at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:951)
02-03 12:43:35.500: W/System.err(24792): at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:337)
02-03 12:43:35.500: W/System.err(24792): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:607)
02-03 12:43:35.500: W/System.err(24792): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:536)
02-03 12:43:35.500: W/System.err(24792): at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:272)
02-03 12:43:35.500: W/System.err(24792): at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:231)

Where could I be going wrong? Any help would be appreciated this is probably the wrong forum to ask but could not figure out where else I could ask.

Import package org.apache.http does not exist

/Users/sethallison/Projects/GuardianWindowInsight_android_exp/InsightApp/climaguardapp_final/platforms/android/com.flyingsoftgames.xapkreader/climaguardglass-library/src/com/google/android/vending/licensing/APKExpansionPolicy.java
Error:(20, 23) error: package org.apache.http does not exist
Error:(21, 36) error: package org.apache.http.client.utils does not exist
same in
/Users/sethallison/Projects/GuardianWindowInsight_android_exp/InsightApp/climaguardapp_final/platforms/android/com.flyingsoftgames.xapkreader/climaguardglass-library/src/com/google/android/vending/licensing/ServerManagedPolicy.java

Tried these http://stackoverflow.com/questions/31433687/android-gradle-apache-httpclient-does-not-exist, most articles are around this line but it does not work.

Which versions of Cordova is this plugin compatible with?

Which versions of Cordova is this plugin compatible with?

I'm using Cordova 4.0 and can't get it working. I can upload the APK to the store and the expansion pack, but when I install it says "Download Failed"

I tried reverting back to an earlier version with:

sudo npm install -g [email protected]

But that command isn't working on my system. I have Node 4.0

Error with XAPKreader

Having a problem executing cordova run --device android. I've installed the following plugin so that I can get expansion file to work on google play store

cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git

I'm going through these step and got to Test the Expansion File from Your Desktop, when I build the project I get the following

my Cordova version is 5.2.0

android run successfully!
exec: cordova run --device android
Run your Cordova Project for android ...
Running command: cmd "/s /c "C:\Users\XXXXXXXX\kidsOrain\www\platforms\android\cordova\run.bat --device""

ANDROID_HOME=C:\Users\XXXXXXXX\Desktop\adt-bundle-windows-x86_64-20131030\sdk
JAVA_HOME=C:\Program Files\Java\jdk1.8.0_25
[snip]

licensing issues

I've fully read all the past issues and tried to reinstall this plugin several times but I'm still getting these issues.

issue with this plugin

Hi,
I am very interesting this plugin.
I want to donate if you can help very small thing.

Are you available now?

5.3.1.

Cordova 5+ uses only gradle, so changes had to be made to the coding. Cordova 5 also uses a mandatory whitelist plugin by default, so we need to account for that.

5.3.1 fixes the library naming issues of 5 through ???. No more messing around with that.

https://github.com/agamemnus/cordova-plugin-xapkreader/tree/cordova-5.3.1

For anyone upgrading, please let me know how it goes.

Thanks again to everyone who contributed debugging, testing, and writing instructions. Here are the steps. First, install:

  1. cordova plugin add cordova plugin add https://github.com/agamemnus/cordova-plugin-xapkreader.git#cordova-5.3.1

  2. In plugins/com.flyingsoftgames.xapkreader/plugin.xml, set xapk_expansion_authority and plugins/com.flyingsoftgames.xapkreader (untested by me -- if this doesn't work, try modifying android.json instead).

  3. cordova add platform android

  4. cordova run android (with the device connected and .obb file loaded on the device)

  5. Now, if you are having trouble with the automatic OBB downloader (it should start if OBBs are missing, but in RELEASE mode only and using the Google Play APK only (??questionable??)), do this: in platforms/android/src/com/flyingsoftgames/xapkreader/XAPKDownloaderActivity.java, change return isDebug; to return true;.

  6. Cordova 5 has a whitelist plugin requirement -- cordova-plugin-whitelist. At present, it is bugged and you need to add in some extra stuff to make sure your files are able to be read (due to too-restrictive default security)
    You can do it one of two ways (or both):
    6A) In your index.html file, you also need to add a Content-Security-Policy meta tag. Note that the instructions on the whitelist plugin on github do not show the most permissive meta tag and forget about content:// or cdvfile://. The most permissive meta tag seems to be: <meta http-equiv="Content-Security-Policy" content="* * 'self' default-src 'unsafe-inline' 'unsafe-eval' http://* https://* data: cdvfile://* content://*;">. (content:// and cdvfile:// should really be included by default. If you want to omit those, I made a patch here: https://github.com/agamemnus/cordova-plugin-whitelist)
    6B) Make sure to add allow-navigation, and allow-intent, and extra access origin tags to root/config.xml. E.G.:

    <allow-navigation href="*://*/*"/>
    <allow-intent href="*" />
    <access origin="*" />
    <access origin="content:///*" />
    <access origin="cdvfile:///*" />

NOTE: Please do not post any logs here unless needed for showing any error you might have.

A way to update content, when the srcof a file change ? (Using angular)

Hi @agamemnus,

First thanks for the update you provide to us.
I finally return to my first choice using your plugin. Now, it's working as i need. Excepted one thing

I am using angular js in my application. That means, some url could change during the navigation. without re creating all the html stuff.
Someting like that:

<img src="content://com.myname.appname/image.jpg" />

If I modify the source of the img using js. The image won't show. I think this is normal and it's not bug.
But i really need something dynamic... What should i do ? How works the contentResolver in your plugin ? Thank you.

Unable to access the files in my expansion

Hello!

Thank you for making this plugin - it seems much easier than others i have found.
However i am unable to acces the audio files in my expansion.
I have a number of .mp3's in a filesystem, which i have made into an uncompressed expansion named main.1.emmagadikke.app in accordance with this. This file is placed under /mnt/sdcard/Android/obb/dk.emmagadikke.app. (Have tried both on emulator and on my phone)

I then installed the plugin successfully, modified project.properties and modified android.json.
I then hoped to be able to acces the audio files whith cordovas new Media-callback:
new Media("content://dk.emmagadikke.expansion/path/to/file.mp3", successCallback(), errorCallback())
, but unfortunately the errorCallback is always executed.>

It seems it just doesn't find the expansion.
xapk_expansion_authority is dk.emmagadikke.expansion in xapkreader.xlm.

I am probably missing some small and simple thing, but i am afraid i don't really know where to start.
Any suggestions are most appreciated.

// thanks!

Path not found

Hello dear,

I have followed all steps, but my images were not showing. Please give me any ideas of this issue.

Thanks beforehand,

Gradle patch (work in progress)

Cordova 5 ignores the ant build system. It uses gradle, instead. That means that the links to the Google Play downloader and licensing libraries are broken. To fix that, we need to use a build-extras.gradle file, and do some other things...

Due to some various Cordova 5 issues/bugs, a fully working Cordova 5 version isn't currently available. (there is a test Cordova-5 branch, however) Here are steps to make this plugin work for Cordova 5 (PLEASE NOTE THESE ARE STILL DRAFT INSTRUCTIONS):

  1. Create a /platforms/android/com.flyingsoftgames.xapkreader/ directory.
  2. Copy your /plugins/com.flyingsoftgames.xapkreader/android-sdk/extras/google/play_apk_expansion/downloader_library directory contents and your /plugins/com.flyingsoftgames.xapkreader/android-sdk/extras/google/play_licensing/library directory contents to /platforms/android/com.flyingsoftgames.xapkreader/downloader_library and /platforms/android/com.flyingsoftgames.xapkreader/library.
  3. Instead of the single reference we added before, add this instead to project.properties:
android.library.reference.2=com.flyingsoftgames.xapkreader/downloader_library
android.library.reference.3=com.flyingsoftgames.xapkreader/library
  1. Inside downloader_library, add a file named build-extras.gradle, with the following contents:
dependencies {
debugCompile project(path: ':com.flyingsoftgames.xapkreader:library',configuration: "debug")
releaseCompile project(path: ':com.flyingsoftgames.xapkreader:library',configuration: "release")
}
  1. The automatic downloader DOES NOT SEEM TO WORK. We must disable it. In platforms/android/src/com/flyingsoftgames/xapkreader/XAPKDownloaderActivity.java, change return isDebug; to return true;.

6a) Cordova 5 has a whitelist plugin requirement. New builds have it by default. You must add this: cordova plugin add cordova-plugin-whitelist. In your index.html file, you also need to add a Content-Security-Policy meta tag. Note that the instructions on the whitelist plugin on github do not show the most permissive meta tag and forget about content:// or cdvfile://. The most permissive meta tag seems to be: <meta http-equiv="Content-Security-Policy" content="* * 'self' default-src 'unsafe-inline' 'unsafe-eval' http://* https://* data: cdvfile://* content://*;">. (content:// and cdvfile:// should really be included by default. If you want to omit those, I made a patch here: https://github.com/agamemnus/cordova-plugin-whitelist)

6b)
Make sure to add allow-navigation, and allow-intent, and extra access origin tags to config.xml. E.G.:

    <allow-navigation href="*://*/*"/>
    <allow-intent href="*" />
    <access origin="*" />
    <access origin="content:///*" />
    <access origin="cdvfile:///*" />

NOTE 1: Please do not post any logs here (unless absolutely necessary)!
NOTE 2: If you are on Crosswalk, note that you must use the plugin method for Cordova 5+ builds. The migrate method no longer works.

5.3.1, Error: more than one library with package name 'com.android.vending.expansion.downloader'

After getting this error:
#33

I reinstalled the xapkreader with the 5.3.1 branch and got the error below. I'm fairly sure this problem is on my end but I have no idea how to solve it.

Error: more than one library with package name 'com.android.vending.expansion.downloader'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0

Build failure when using cordova-plugin-xapkreader

Hi,

I receive the following error when trying to build my app via the terminal.

What went wrong:

Execution failed for task ':..:..:plugins:com.flyingsoftgames.xapkreader:android-sdk:extras:google:play_apk_expansion:downloader_library:compileDebugJava'.
> Compilation failed; see the compiler error output for details.

Can you please help?

xapk_expansion_authority meaning

Hi,
first of all, thank you for your efforts, I really appreciate your work.

I'm trying to test your plugin in a simple app (the default cordova sample, brand new created). But looks like I'm not having success so far.
Maybe my mistake is in the xapk_expansion_authority.

Let's say I have an app with the following package name:
com.company.appname

and an expansion file , obtained uplading a zip compressed foleder photo.zip and named main.1.it.com.company.appname.obb

What should I use as xapk_expansion_authority?

com.company.appname,
com.company.appname.expansion,
main.1.it.com.company.appname.obb
or
main.1.it.com.company.appname.obb.expansion?

Thanks for any kind of help
Ale

Can't access .jpg in my expansion file

I am using this format, changing:

< img src="0buggies/018-buggies/wallpaper-rc8.2e.jpg" width="500" />

to
< img src="content://com.companyname.myapp/0buggies/018-buggies/wallpaper-rc8.2e.jpg" width="500" />

[The space after the < symbol is deliberate so it doesn't kick in the HTML conversion.] But the area is still blank. Please let me know if I got this part right. If so, then something else is wrong somewhere. Perhaps "content://" is supposed to be a variable for something else?

Alpha test issue

I've used the plugin successfully in local debug, I'm able to produce the debug apk create the folder and put the obb and everything work fine, but when I upload it in alpha test and install the app using the google play store, the app get stuck in the download screen with error download failed.

"download failed because you may not have purchased this app"

I've tried waiting the day after the upload but the issues is still there.

Also I've noticed that the app create the right folder in Android/obb/xxx folder and and inside there is already the obb, so I don't understand why there is a downloading screen in app

Is this bug or a wrong configuration?

Splash screens and cordova-plugin-xapkreader: Conflict?

First, thank you for your hard working making this great plugin available to the public. We definitely consider donating!

After adding cordova-plugin-xapkreader to a project (using Cordova 4.1.2), the splash screen defined in config.xml with

    <preference name="SplashScreen" value="screen" />

don’t show up anymore. To verify it is cordova-plugin-xapkreader causing the splash screen to not show up, I removed cordova-plugin-xapkreader from the project. In the project without cordova-plugin-xapkreader, the splash screen shows up as expected. Then, I re-added cordova-plugin-xapkreader, and the splash screen is gone again.

Debugging CordovaActivity.loadUrl(), which is responsible for finding the splash screen files, didn’t suggest anything going wrong. CordovaActivity.showSplashScreen() also worked smoothly.

Any thoughts how to fix this?

Conflict with appfeel/admob-google-cordova plugin

After installation and editing the files per the instructions, upon compilation with cordova build --release, I get several errors pertaining to the appfeel/cordova/admob plugin.

-compile:
    [javac] Compiling 34 source files to /home/appsuser/app0/platforms/android/ant-build/classes
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:58: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.AdRequest;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:59: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.AdSize;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:60: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.AdView;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:61: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.InterstitialAd;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:62: error: package com.google.android.gms.ads.mediation.admob does not exist
    [javac] import com.google.android.gms.ads.mediation.admob.AdMobExtras;
    [javac]                                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:63: error: package com.google.android.gms.ads.purchase does not exist
    [javac] import com.google.android.gms.ads.purchase.InAppPurchase;
    [javac]                                           ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:32: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.AdListener;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:33: error: package com.google.android.gms.ads does not exist
    [javac] import com.google.android.gms.ads.AdRequest;
    [javac]                                  ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:36: error: cannot find symbol
    [javac] public class AdMobAdsAdListener extends AdListener {
    [javac]                                         ^
    [javac]   symbol: class AdListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:33: error: package com.google.android.gms.ads.purchase does not exist
    [javac] import com.google.android.gms.ads.purchase.InAppPurchase;
    [javac]                                           ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:34: error: package com.google.android.gms.ads.purchase does not exist
    [javac] import com.google.android.gms.ads.purchase.InAppPurchaseListener;
    [javac]                                           ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:37: error: cannot find symbol
    [javac] public class AdMobAdsAppPurchaseListener implements InAppPurchaseListener {
    [javac]                                                     ^
    [javac]   symbol: class InAppPurchaseListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:111: error: cannot find symbol
    [javac]   private AdView adView;
    [javac]           ^
    [javac]   symbol:   class AdView
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:117: error: cannot find symbol
    [javac]   private InterstitialAd interstitialAd;
    [javac]           ^
    [javac]   symbol:   class InterstitialAd
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:123: error: cannot find symbol
    [javac]   private AdSize adSize = AdSize.SMART_BANNER;
    [javac]           ^
    [javac]   symbol:   class AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:337: error: cannot find symbol
    [javac]   private AdRequest buildAdRequest() {
    [javac]           ^
    [javac]   symbol:   class AdRequest
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:637: error: cannot find symbol
    [javac]   public static AdSize adSizeFromString(String size) {
    [javac]                 ^
    [javac]   symbol:   class AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:40: error: cannot find symbol
    [javac]   private SparseArray<InAppPurchase> purchases = new SparseArray<InAppPurchase>();
    [javac]                       ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAdsAppPurchaseListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:47: error: cannot find symbol
    [javac]   synchronized public void onInAppPurchaseRequested(final InAppPurchase inAppPurchase) {
    [javac]                                                           ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAdsAppPurchaseListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:60: error: cannot find symbol
    [javac]   public InAppPurchase getPurchase(int purchaseId) {
    [javac]          ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAdsAppPurchaseListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:123: error: cannot find symbol
    [javac]   private AdSize adSize = AdSize.SMART_BANNER;
    [javac]                           ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:295: error: cannot find symbol
    [javac]       adView = new AdView(cordova.getActivity());
    [javac]                    ^
    [javac]   symbol:   class AdView
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:297: error: cannot find symbol
    [javac]         if (adSize == AdSize.BANNER) { // 320x50
    [javac]                       ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:299: error: cannot find symbol
    [javac]         } else if (adSize == AdSize.MEDIUM_RECTANGLE) { // 300x250
    [javac]                              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:303: error: cannot find symbol
    [javac]         } else if (adSize == AdSize.FULL_BANNER) { // 468x60
    [javac]                              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:304: error: cannot find symbol
    [javac]           adView.setAdSize(AdSize.BANNER);
    [javac]                            ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:305: error: cannot find symbol
    [javac]         } else if (adSize == AdSize.LEADERBOARD) { // 728x90
    [javac]                              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:306: error: cannot find symbol
    [javac]           adView.setAdSize(AdSize.BANNER);
    [javac]                            ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:307: error: cannot find symbol
    [javac]         } else if (adSize == AdSize.SMART_BANNER) { // Screen width x 32|50|90
    [javac]                              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:310: error: cannot find symbol
    [javac]             adView.setAdSize(new AdSize(768, 90));
    [javac]                                  ^
    [javac]   symbol:   class AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:312: error: cannot find symbol
    [javac]             adView.setAdSize(AdSize.BANNER);
    [javac]                              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:338: error: package AdRequest does not exist
    [javac]     AdRequest.Builder request_builder = new AdRequest.Builder();
    [javac]              ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:338: error: package AdRequest does not exist
    [javac]     AdRequest.Builder request_builder = new AdRequest.Builder();
    [javac]                                                      ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:343: error: cannot find symbol
    [javac]       request_builder = request_builder.addTestDevice(deviceId).addTestDevice(AdRequest.DEVICE_ID_EMULATOR);
    [javac]                                                                               ^
    [javac]   symbol:   variable AdRequest
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:358: error: cannot find symbol
    [javac]     AdMobExtras adextras = new AdMobExtras(bundle);
    [javac]     ^
    [javac]   symbol:   class AdMobExtras
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:358: error: cannot find symbol
    [javac]     AdMobExtras adextras = new AdMobExtras(bundle);
    [javac]                                ^
    [javac]   symbol:   class AdMobExtras
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:360: error: cannot find symbol
    [javac]     AdRequest request = request_builder.build();
    [javac]     ^
    [javac]   symbol:   class AdRequest
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:498: error: cannot find symbol
    [javac]     interstitialAd = new InterstitialAd(cordova.getActivity());
    [javac]                          ^
    [javac]   symbol:   class InterstitialAd
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:552: error: cannot find symbol
    [javac]     final InAppPurchase purchase = inAppPurchaseListener.getPurchase(purchaseId);
    [javac]           ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:575: error: cannot find symbol
    [javac]     final InAppPurchase purchase = inAppPurchaseListener.getPurchase(purchaseId);
    [javac]           ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:639: error: cannot find symbol
    [javac]       return AdSize.BANNER;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:641: error: cannot find symbol
    [javac]       return AdSize.MEDIUM_RECTANGLE;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:643: error: cannot find symbol
    [javac]       return AdSize.FULL_BANNER;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:645: error: cannot find symbol
    [javac]       return AdSize.LEADERBOARD;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:647: error: cannot find symbol
    [javac]       return AdSize.SMART_BANNER;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAds.java:649: error: cannot find symbol
    [javac]       return AdSize.SMART_BANNER;
    [javac]              ^
    [javac]   symbol:   variable AdSize
    [javac]   location: class AdMobAds
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:47: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:60: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:82: error: cannot find symbol
    [javac]     case AdRequest.ERROR_CODE_INTERNAL_ERROR:
    [javac]          ^
    [javac]   symbol:   variable AdRequest
    [javac]   location: class AdMobAdsAdListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:85: error: cannot find symbol
    [javac]     case AdRequest.ERROR_CODE_INVALID_REQUEST:
    [javac]          ^
    [javac]   symbol:   variable AdRequest
    [javac]   location: class AdMobAdsAdListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:88: error: cannot find symbol
    [javac]     case AdRequest.ERROR_CODE_NETWORK_ERROR:
    [javac]          ^
    [javac]   symbol:   variable AdRequest
    [javac]   location: class AdMobAdsAdListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:91: error: cannot find symbol
    [javac]     case AdRequest.ERROR_CODE_NO_FILL:
    [javac]          ^
    [javac]   symbol:   variable AdRequest
    [javac]   location: class AdMobAdsAdListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:98: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:111: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAdListener.java:123: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:40: error: cannot find symbol
    [javac]   private SparseArray<InAppPurchase> purchases = new SparseArray<InAppPurchase>();
    [javac]                                                                  ^
    [javac]   symbol:   class InAppPurchase
    [javac]   location: class AdMobAdsAppPurchaseListener
    [javac] /home/appsuser/app0/platforms/android/src/com/appfeel/cordova/admob/AdMobAdsAppPurchaseListener.java:46: error: method does not override or implement a method from a supertype
    [javac]   @Override
    [javac]   ^
    [javac] Note: /home/appsuser/app0/platforms/android/src/org/apache/cordova/file/DirectoryManager.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] Note: /home/appsuser/app0/platforms/android/src/org/apache/cordova/file/ContentFilesystem.java uses unchecked or unsafe operations.
    [javac] Note: Recompile with -Xlint:unchecked for details.
    [javac] 57 errors

BUILD FAILED
/home/appsuser/android-studio/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/home/appsuser/android-studio/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Cordova 6.x.x

When will be version of this plugin for new Cordova 6.4.0?

Thanks!

Spaces in Filenames and Folders

Once again great plugin.

I have picked up an issue with spaces in File names and Folders.

My App, I have taken a clients CD version of their product and placed all the files in a OBB file, but there are spaces in the directory structure of the CD. There are hundreds of examples like this on my CD.
Example:
content://za.co.anomalous.cfourk/main_expansion/5/Templates/store/7/Ad Campaign Template.ppt

I thought it could be an encode issue so I tried this.

encodeURI("content://za.co.anomalous.cfourk/main_expansion/5/Templates/store/7/Ad Campaign Template.ppt")

This would put a %20 where ever there was a space but I still got the same error

java.io.FileNotFoundException
W/System.err(10908): at com.flyingsoftgames.xapkreader.XAPKProvider.openAssetFile(XAPKProvider.java:115)
02-05 11:15:33.389: W/System.err(10908): at android.content.ContentProvider.openTypedAssetFile(ContentProvider.java:951)
02-05 11:15:33.389: W/System.err(10908): at android.content.ContentProvider$Transport.openTypedAssetFile(ContentProvider.java:337)
02-05 11:15:33.399: W/System.err(10908): at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:607)
02-05 11:15:33.399: W/System.err(10908): at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:536)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:272)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.CordovaResourceApi.openForRead(CordovaResourceApi.java:231)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.ContentFilesystem.readFileAtURL(ContentFilesystem.java:229)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.Filesystem.copyFileToURL(Filesystem.java:121)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.LocalFilesystem.copyFileToURL(LocalFilesystem.java:524)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.FileUtils.transferTo(FileUtils.java:715)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.FileUtils.access$10(FileUtils.java:698)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.FileUtils$22.run(FileUtils.java:494)
02-05 11:15:33.399: W/System.err(10908): at org.apache.cordova.file.FileUtils$25.run(FileUtils.java:577)
02-05 11:15:33.399: W/System.err(10908): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
02-05 11:15:33.409: W/System.err(10908): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)

I tired a few other tests
string.replace(" ","%20");
string.replace(" ","\ ");

But no joy

It could be a simple fix but have run out of time so just putting this here for your information, I decided to write a script to replace all the " " with "_" in the obb file to avoid the space issues. Maybe should have thought of that in the beginning, but maybe someone in the future wont have direct control over the obb file.

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.