Following ngCordova tutorials - failing to build for android now


#1

Hi,

I’ve used this tutorial http://ngcordova.com/docs/plugins/facebook/ to integrate Facebook SDK.

Failing to finish on the last step of

cordova build android

due to the changes requested by that tutorial.

My manifest of platforms/android/com.phonegap.plugins.facebookconnect/sportcial623634-FacebookLib/ is:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  package="com.facebook.android">
    <application/>
    <uses-sdk android:minSdkVersion='14' android:targetSdkVersion='22' />
</manifest>

Java java version "1.8.0_40"
Cordova Installed platforms: android 3.7.1, ios 3.8.0
Mac OSX latest

And the errors im getting:

    -compile:
[javac] Compiling 97 source files to /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/ant-build/classes
[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] target value 1.5 is obsolete and will be removed in a future release
[javac] warning: [options] To suppress warnings about obsolete options, use -Xlint:-options.
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewClient.java:35: error: cannot find symbol
[javac] import android.webkit.ClientCertRequest;
[javac]                      ^
[javac]   symbol:   class ClientCertRequest
[javac]   location: package android.webkit
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewClient.java:145: error: cannot find symbol
[javac]     public void onReceivedClientCertRequest (WebView view, ClientCertRequest request)
[javac]                                                            ^
[javac]   symbol:   class ClientCertRequest
[javac]   location: class CordovaWebViewClient
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaChromeClient.java:342: error: cannot find symbol
[javac]     public boolean onShowFileChooser(WebView webView, final ValueCallback<Uri[]> filePathsCallback, final WebChromeClient.FileChooserParams fileChooserParams) {
[javac]                                                                                                                          ^
[javac]   symbol:   class FileChooserParams
[javac]   location: class WebChromeClient
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:25: error: cannot find symbol
[javac] import android.webkit.ClientCertRequest;
[javac]                      ^
[javac]   symbol:   class ClientCertRequest
[javac]   location: package android.webkit
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:32: error: cannot find symbol
[javac]     private final ClientCertRequest request;
[javac]                   ^
[javac]   symbol:   class ClientCertRequest
[javac]   location: class CordovaClientCertRequest
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaClientCertRequest.java:34: error: cannot find symbol
[javac]     public CordovaClientCertRequest(ClientCertRequest request) {
[javac]                                     ^
[javac]   symbol:   class ClientCertRequest
[javac]   location: class CordovaClientCertRequest
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaChromeClient.java:340: error: cannot find symbol
[javac]     @TargetApi(Build.VERSION_CODES.LOLLIPOP)
[javac]                                   ^
[javac]   symbol:   variable LOLLIPOP
[javac]   location: class VERSION_CODES
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java:197: error: cannot find symbol
[javac]         if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
[javac]                                                        ^
[javac]   symbol:   variable LOLLIPOP
[javac]   location: class VERSION_CODES
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebView.java:200: error: cannot find symbol
[javac]             cookieManager.setAcceptThirdPartyCookies(this, true);
[javac]                          ^
[javac]   symbol:   method setAcceptThirdPartyCookies(CordovaWebView,boolean)
[javac]   location: variable cookieManager of type CookieManager
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaWebViewClient.java:143: error: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaChromeClient.java:341: error: method does not override or implement a method from a supertype
[javac]     @Override
[javac]     ^
[javac] /Users/glfx/Projects/Sportcial/platforms/android/CordovaLib/src/org/apache/cordova/CordovaChromeClient.java:348: error: cannot find symbol
[javac]                     Uri[] result = WebChromeClient.FileChooserParams.parseResult(resultCode, intent);
[javac]                                                   ^
[javac]   symbol:   variable FileChooserParams
[javac]   location: class WebChromeClient
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[javac] 12 errors
[javac] 3 warnings

BUILD FAILED
/Users/glfx/Library/Android/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/glfx/Library/Android/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/glfx/Library/Android/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 2 seconds

/Users/glfx/Projects/Sportcial/platforms/android/cordova/node_modules/q/q.js:126
            throw e;
                  ^
Error code 1 for command: ant with args: debug,-f,/Users/glfx/Projects/Sportcial/platforms/android/build.xml,-    Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
ERROR building one of the platforms: Error: /Users/glfx/Projects/Sportcial/platforms/android/cordova/build:     Command failed with exit code 1
You may not have the required environment or OS to build this project
Error: /Users/glfx/Projects/Sportcial/platforms/android/cordova/build: Command failed with exit code 1
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-    lib/src/cordova/superspawn.js:131:23)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)

Please HALP :slight_smile: I badly need the facebook sdk… natively… not OpenFB :<


#2

Same issue here. Any solution to this?


#3

Try this.

cordova platform update android

or

ionic platform update android


#4

Thank you. This worked for me.