34

I am using phonegap-2.9.0 with file plugin. When I build project for android platform it creates two packages within the src/ folder:

org.apache.cordova.file
org.apache.cordova.filetransfer

I get below errors within these two packages:

1 - org.apache.cordova.file.FileUtils

Method testSaveLocationExists() from the type DirectoryManager is not visible
Method getFreeDiskSpace() from the type DirectoryManager is not visible
Method testFileExists() from the type DirectoryManager is not visible

2 - org.apache.cordova.filetransfer.FileTransfer

import org.apache.cordova.CordovaResourceApi unresolved
import org.apache.cordova.CordovaResourceApi.OpenForReadResult unresolved

Could someone please tell me what I should do to resolve these?

Thanks.

3
  • Hi! I don't know if it's an option, but personally I really enjoy using Phonegap Build (free) and let them do all the system configuration for me build.phonegap.com. Nowdays the only thing I need to do is to upload a zip containing the entire project (and config.xml) then simply download the built IPA and APK. Feb 27, 2014 at 11:01
  • Another shot in the dark, I remember having similar issues in the past occuring when not also including the Device-plugin (github.com/apache/cordova-plugin-device/blob/master/doc/…). Anyhow, good luck! Feb 27, 2014 at 11:17
  • Did you add the plugin to the config.xml? Also, if you go into the src folder, do you see an org directory? Feb 27, 2014 at 23:29

4 Answers 4

1

You have two problems.

1) Version of Phonegap is outdated

2) The way to install a plugin is:

-> phonegap plugin add "urlofplugin" or "/path""

-> phonegap platform add android

-> phonegap prepare

-> phonegap build

sometimes the plugin has a different default installation, the files need to change the platform.

0

Well, I dont know if I can help you, but I had similar problems. When I installed exactly those two plugins I got an error too. A different one, which I dont perticularly remember, something to do with a missing file that I can easily find in the file manager. Anyway, what helped me was:

  1. I updated to a more recent version, if you are able to I advice for it.
  2. After installing the plugins through cordova cmd api (.nodejs command prompt ... you know what I mean) I was forgetting to build in the api itself. It sounds stupid but I was using wp8 and thus using a template for visual studio. The studio gave me the error, the building process (in cmd) also gave errors, but it was fixed by updating to the newer version.
0

You need to configure you build path and then add library from external source and select the library then it will resolve or u can make copy and paste cordova library .jar file in your lib folder. then it will remove, if not happen then tell me .......

0

I am not sure if that will work but first uninstall these plugins using phonegap/cordova CLI and than reinstall it in the root of application folder using the CLI only like this:

phonegap local plugin add <required plugin>

This worked for me after reinstallation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.