2015-03-26 5 views
6

ich diese Anweisungen befolgt Facebook SDK für meine Cordova/Ionic Projekt einzurichten: http://ngcordova.com/docs/plugins/facebook/Cordova nicht für Android bauen nach Konfiguration Anpassen

Für iOS alles gut funktioniert, aber für Android, dem letzten Schritt des

cordova build android

irgendwie seltsame Fehler:

-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) 

Meine Manifest-Datei:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.facebook.android"> 
    <application/> 
    <uses-sdk android:minSdkVersion='14' android:targetSdkVersion='21' /> 
</manifest> 

Ich habe versucht, Java-Version zu aktualisieren, Ziel SDK-Version zu ändern, googeln .. kein Glück.

Einige Details:

java version "1.8.0_40"

Cordova:

installierte Plattformen: Android 3.7.1, ios 3.8.0

Mac OSX neuesten.

Bitte assistieren.

+0

Try yo die neueste Build-Tools SDK verwenden, ich sehe, dass cordova Verweise auf loolipop ... –

+0

Das ist, was ich mit ... API 21, die 5,0 ist, ich habe gerade versucht, 22, Das ist 5.1 .. gleiche Fehler. – deb0rian

Antwort

0

Installieren Sie Android Build Tools Version 21 und 22 von SDK Manager.
Sobald die Build-Tools installiert sind, entfernen Sie den Plattformordner in Ihrer App.
Gehen Sie nach Cordova und fügen Sie die Android-Plattform erneut (mit Cordova-Plattform hinzufügen Android Befehl).
umbauen dann die app (cordova build-Befehl), und es wird erfolgreich

+0

funktioniert nicht. Ich habe es mit ionischen aber versucht. – Dhiren

+2

In meinem Fall möchte ich Android-Version 19, jede Hilfe erstellen? –

1

Heute baut ich gleiches Problem konfrontiert, mit AdvancedWebView und cordova verwandten Problem gefunden. für Ant-Benutzer, überprüfen Sie einfach project.properties Datei. Ändern Sie den

target=android-21