PDF417 / pdf417-phonegap

PDF417 and QR code scanning plugins for PhoneGap/Cordova framework
47 stars 21 forks source link

pdf417-Phonegap compilation error #6

Closed shepherdsiduli closed 10 years ago

shepherdsiduli commented 10 years ago

Hi guys,

I need help guys, I have been trying to do the sample project on following link https://github.com/PDF417/pdf417-phonegap I keep getting a compilation error, Please see error log below

[javac] Compiling 7 source files to /Users/xxx/testcordova/platforms/android/ant-build/classes
[javac] /Users/xxx/testcordova/platforms/android/src/com/phonegap/plugins/pdf417/MyViewfinder.java:3: error: cannot find symbol
[javac] import mobi.pdf417.R;
[javac]                   ^
[javac]   symbol:   class R
[javac]   location: package mobi.pdf417
[javac] /Users/xxx/testcordova/platforms/android/src/com/phonegap/plugins/pdf417/MyViewfinder.java:21: error: package R does not exist
[javac]         mBackButton = (Button)mLayout.findViewById(R.id.btnBack);
[javac]                                                     ^
[javac] /Users/xxx/testcordova/platforms/android/src/com/phonegap/plugins/pdf417/MyViewfinder.java:30: error: package R does not exist
[javac]         mTorchButton = (Button)mLayout.findViewById(R.id.btnTorch);
[javac]                                                      ^
[javac] /Users/xxx/testcordova/platforms/android/src/com/phonegap/plugins/pdf417/MyViewfinder.java:46: error: package R does not exist
[javac]                         mTorchButton.setText(R.string.LightOn);
[javac]                                               ^
[javac] /Users/xxx/testcordova/platforms/android/src/com/phonegap/plugins/pdf417/MyViewfinder.java:48: error: package R does not exist
[javac]                         mTorchButton.setText(R.string.LightOff);
[javac]                                               ^
[javac] 5 errors

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

Total time: 3 seconds Error code 1 for command: ant with args: debug,-f,/Users/xxx/testcordova/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen Error: /Users/xxx/testcordova/platforms/android/cordova/build: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23) at ChildProcess.emit (events.js:98:17) at maybeClose (child_process.js:755:16) at Process.ChildProcess._handle.onexit (child_process.js:822:5)

lhabjane commented 10 years ago

Hi,

have you followed instructions https://github.com/PDF417/pdf417-phonegap#android ? This seems like a problem with dependency on pdf417 mobi library project.

to verify this, can you post your project/platforms/android/project.properties contents?

shepherdsiduli commented 10 years ago

Here are steps I followed

pull the plugin and sample application from Github

Step 1 : git clone git@github.com:PDF417/pdf417-phonegap.git

create a empty application

Step 2 : cordova create testcordova Step 3 : cd testcordova Step 4: cordova plugin add ../pdf417-phonegap/Pdf417 Step 5: cordova platform add android Step 6: android update project --target 12 --path platforms/android/ --library ../../../pdf417-phonegap/Pdf417/src/android/Pdf417MobiSdk Step 7: android update project --name testphone --target 12 --path platforms/android/ Step 8: android update lib-project --target 12 --path ../pdf417-phonegap/Pdf417/src/android/Pdf417MobiSdk/ Step 9 : cordova build android Then the error followed

Also here are the contents of the project.properties files :

#

This file must be checked in Version Control Systems.

#

To customize properties used by the Ant build system edit # "ant.properties", and override values to adapt the script to your # project structure.

#

To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):

proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

android.library.reference.1=CordovaLib

Project target.

target=android-17 android.library.reference.2=../../../pdf417-phonegap/Pdf417/src/android/Pdf417MobiSdk

lhabjane commented 10 years ago

Hi, we have updated MyViefinder class that was causing problems. Please, try reinstalling new plugin version, it should fix your problem.

shepherdsiduli commented 10 years ago

Thanks its now working