0

so im making this cordova / phonegap application. I found out that The default Phonegap (Cordova) Camera Plugin calls the native camera and this makes Android Garbage Collector to kill background applications.

so I found a plugin that fixes this :

https://code.google.com/p/foreground-camera-plugin/

now I followed the steps as these guys told. and I'm having the following problems that I cant resolve and need help on.

  1. There was a problem with the cameraActivity.java it did not recognize thegenerated file R.java

enter image description here

then I used an import statement to make it have access to this file import statement : import java.android.R;

after this eclipse doesnt recognize the foregroundcameraplugin.xml.

enter image description here

besides this my my styles.xml files in values-v11 and values-v14 directories are giving an error

"Error retrieving parent for item; no reources found that match the given name @android: Theme.Holo.Light.DarkActionBar "

enter image description here

enter image description here

this is how my forground camera plugin looks like :

enter image description here

If anyone knows how too fix this please let me know

thank you

tanzeelrana
  • 377
  • 2
  • 5
  • 10
  • Sometimes `Eclipse` adds `R` file by itself, check your code. If Eclipse imported `R` file, delete it. Clean your project and try to run it. – Gokhan Arik Jun 18 '13 at 20:36
  • if i delete the R file my project wont compile – tanzeelrana Jun 18 '13 at 21:00
  • I didn't mean to delete file, delete the import statement `import android.R`, clean your project and try to run. R files are automatically generated, your package should have in `/res` folder, you have to use it. `android.R` is a kind of default file. Check this answer : [import android.R in Eclipse : Why?](http://stackoverflow.com/a/15309999/1106598) – Gokhan Arik Jun 18 '13 at 21:07
  • now I get it why my CameraActivity.java file has an error. where do I remove the import android.R statement from ? .... from my Camera.Activity.java file ? – tanzeelrana Jun 18 '13 at 21:14
  • Yes, it is in your java file on top. it is a `import` command, you will see. Check your all classes. If you are using Eclipse auto import command (Ctrl+Shift+O) this class is usually added by Eclipse. – Gokhan Arik Jun 18 '13 at 21:18
  • okay after I remove the import command how will I generate the R.java file which includes all my up to date resources ? because when I try to run the project it fails to run – tanzeelrana Jun 18 '13 at 21:20
  • and another thing is that when ever I click the run button my eclipse starts re-indexing repositories .... and the computer fan starts up and the computer speed drops until I stop the re-indexing – tanzeelrana Jun 18 '13 at 21:24
  • Clean your project (Project->Clean) and try to build again. If it fails to build and doesn't generate R file, check your XML files. Might be error in your xml files. – Gokhan Arik Jun 18 '13 at 21:25
  • when I try to clean the project it gives me the following error : [2013-06-18 17:27:18 - cordova_camTestApp] Failed to create BuildConfig class – tanzeelrana Jun 18 '13 at 21:27
  • in your `AndroidManifest` file, what is target SDK and minSDK? – Gokhan Arik Jun 18 '13 at 21:34

1 Answers1

0

I was able to reply the error with the new Eclipse Kepler and found the solution: upgrade your ADT to version 22 and install Android SDK Build-tools by SDK manager. I have also commited a new classpath file for ForegroundCameraPlugin project with some changes (included Android Private Libraries). Thanks to your contact and the help of this link: Eclipse giving error, missing R.java file after recent update

Community
  • 1
  • 1