rohfosho / CordovaCallNumberPlugin

Call a number directly from your cordova application.
MIT License
185 stars 151 forks source link

Latest Commit Breaks Android Build #21

Closed calanti closed 7 years ago

calanti commented 8 years ago

Latest commit (648d98b) breaks android build for me, also tried 19/02/2016 commit (ee8a081) with same problem.

After looking though the closed issues, #15 states commit (79333b3) builds successfully, which indeed does work for me and works successfully in my app.

Corvoda version 5.4.1 Java version 1.8.0_74

Error:

:compileDebugJava
C:\PhoneGap\<appname>\platforms\android\src\mx\ferreyra\callnumber\CFCallNumber.java:27: error: cannot find symbol

    cordova.requestPermission(this, requestCode, CALL_PHONE);

           ^

  symbol:   method requestPermission(CFCallNumber,int,String)

  location: variable cordova of type CordovaInterface

C:\PhoneGap\<appname>\platforms\android\src\mx\ferreyra\callnumber\CFCallNumber.java:35: error: cannot find symbol

    if (cordova.hasPermission(CALL_PHONE)) {

               ^

  symbol:   method hasPermission(String)

  location: variable cordova of type CordovaInterface
ERROR building one of the platforms: Error: cmd: Command failed with exit code 1
You may not have the required environment or OS to build this project

Error: cmd: Command failed with exit code 1
NanaPhil commented 8 years ago

Yeah I'm facing the same problem with the latest version of this plugin. can't build to Android . Please can it be fixed as soon as possible?

CFCallNumber.java:27: error: cannot find symbol cordova.requestPermission(this, requestCode, CALL_PHONE); ^ symbol: method requestPermission(CFCallNumber,int,String) location: variable cordova of type CordovaInterface

/android/src/mx/ferreyra/callnumber/CFCallNumber.java:35: error: cannot find symbol if (cordova.hasPermission(CALL_PHONE)) { ^ symbol: method hasPermission(String) location: variable cordova of type CordovaInterface Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 2 errors :compileDebugJava FAILED FAILURE: Build failed with an exception. - What went wrong: Execution failed for task ':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
maxrevilo commented 8 years ago

Same problem here, looks like the people at cordova added cordova.requestPermission from Cordova 5+ to check for the permissions required by Android Marshmallow.

If you have Cordova < 5 you can try with

cordova plugin add https://github.com/Rohfosho/CordovaCallNumberPlugin.git#dd1b05e13f90992668cdf8da730995f98ecfe256

That commit worked for me.

The weird thing is that I have Cordova 5.4.1 but I am still having those build problems, I even recreated the android platform but the problems persists, however I think that's a problem of my environment not a bug of the plugin.

calanti commented 8 years ago

I was just able to use the latest commit, but a lot of my configuration has changed since I last tried so I am not sure where it got fixed. Most likely when I upped the android build spec from 4.1.1 to 5.1.1, you can give this a go by setting it in the config.xml;

<engine name="android" spec="~5.1.1" />

You will probably need the correct Android sdk dependencies for it if you don't already.

of course remove, add and (attempt to) build Android.

Hope this helps!

FutoRicky commented 8 years ago

@maxrevilo Your solution worked for me. Thanks

oseifrimpong commented 7 years ago

@maxrevilo Hey man! Your solution worked for me as well.

YmendezM commented 6 years ago

@maxrevilo Gracias tambien funciono para mi..!!