Closed confile closed 10 years ago
I get a similar issue, but I tried to add the library via command line first.
See https://stackoverflow.com/questions/22913089/cordova-3-4-facebook-connect-add-library
Help is really appreciated. Thanks!
@confile did you add the Facebook library project as a dependency as mentioned in the README.md?
@aogilvie Yes I did. Here is what I did:
cordova create Test com.example "Test"
cordova platform add android
cordova -d plugin add /Users/mg/Documents/Android/Plugins/phonegap-facebook-plugin --variable APP_ID="1234567" --variable APP_NAME="testtest"
cp platforms/android/local.properties platforms/android/FacebookLib
echo "android.library.reference.2=FacebookLib" >> platforms/android/project.properties
myApp/config.xml
<access origin="https://m.facebook.com" />
<access origin="https://graph.facebook.com" />
<access origin="https://api.facebook.com" />
<access origin="https://*.fbcdn.net" />
<access origin="https://*.akamaihd.net" />
<feature name="org.apache.cordova.facebook.Connect">
<param name="android-package" value="org.apache.cordova.facebook.ConnectPlugin" />
</feature>
@confile is that your full output? If not, can you post all?
Here's mine after running :
rm -rf myApp
cordova -v
cordova create myApp
cd myApp/
cordova platform add android
cordova -d plugin add /Users/Ally/Documents/aogilvie/phonegap-facebook-plugin --variable APP_ID="123456789" --variable APP_NAME="MyApp"
Output:
3.3.1-0.1.2
Creating a new cordova project with name "HelloCordova" and id "io.cordova.hellocordova" at location "/Users/Ally/Documents/Wizcorp/testing/plugman/myApp"
Creating android project...
Preparing android project
Calling plugman.fetch on plugin "/Users/Ally/Documents/aogilvie/phonegap-facebook-plugin"
Fetching plugin from "/Users/Ally/Documents/aogilvie/phonegap-facebook-plugin"...
Fetch is reading plugin.xml from location "/Users/Ally/Documents/aogilvie/phonegap-facebook-plugin/plugin.xml"...
Copying from location "/Users/Ally/Documents/aogilvie/phonegap-facebook-plugin" to location "/Users/Ally/Documents/Wizcorp/testing/plugman/myApp/plugins/com.phonegap.plugins.facebookconnect"
Calling plugman.install on plugin "/Users/Ally/Documents/Wizcorp/testing/plugman/myApp/plugins/com.phonegap.plugins.facebookconnect" for platform "android" with options "{"www_dir":"/Users/Ally/Documents/Wizcorp/testing/plugman/myApp/platforms/android/.staging/www","cli_variables":{"APP_ID":"455682744554698","APP_NAME":"TestMobasaka"}}"
Starting installation of "com.phonegap.plugins.facebookconnect" for android
Installing plugin com.phonegap.plugins.facebookconnect
Beginning processing of action stack for android project...
Action stack processing complete.
Preparing android project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'com.phonegap.plugins.facebookconnect' ]
Writing out cordova_plugins.js...
com.phonegap.plugins.facebookconnect installed on android.
Also getting the same building here
Error executing "ant debug -f "/home/ecarbajal/oj-mobile3/platforms/android/build.xml"": BUILD FAILED /home/ecarbajal/android-sdk-linux/tools/ant/build.xml:653: The following error occurred while executing this line: /home/ecarbajal/android-sdk-linux/tools/ant/build.xml:698: null returned: 1
Total time: 10 seconds
child_process.spawn(/home/ecarbajal/oj-mobile3/platforms/android/cordova/build,[]) = 2
/home/ecarbajal/.nvm/v0.10.22/lib/node_modules/cordova/node_modules/q/q.js:126 throw e;
@confile
cp platforms/android/local.properties platforms/android/FacebookLib
You are copying this file why? It's not required. If you performed a clean or something the you need to generate this file. Use android update project -p .
with cordova 3.4.1, follow commands from https://github.com/phonegap/phonegap-facebook-plugin/issues/436#issuecomment-39935487:
$cordova -d plugin add /Users/joetsuihk/Downloads/phonegap-facebook-plugin-master --variable APP_ID="129873860538653" --variable APP_NAME="Doodcard"
Calling plugman.fetch on plugin "/Users/joetsuihk/Downloads/phonegap-facebook-plugin-master"
Copying plugin "/Users/joetsuihk/Downloads/phonegap-facebook-plugin-master" => "/Users/joetsuihk/iOSprojects/myApp2/plugins/com.phonegap.plugins.facebookconnect"
Calling plugman.install on plugin "/Users/joetsuihk/iOSprojects/myApp2/plugins/com.phonegap.plugins.facebookconnect" for platform "android" with options "{"cli_variables":{"APP_ID":"129873860538653","APP_NAME":"Doodcard"}}"
Installing "com.phonegap.plugins.facebookconnect" for android
Install start for "com.phonegap.plugins.facebookconnect" on android.
Beginning processing of action stack for android project...
Action stack processing complete.
Preparing android project
Processing configuration changes for plugins.
Iterating over installed plugins: [ 'com.phonegap.plugins.facebookconnect' ]
Writing out cordova_plugins.js...
Install complete for com.phonegap.plugins.facebookconnect on android.
$cordova build android
Running command: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/cordova/build
Buildfile: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Users/joetsuihk/Development/sdk
-setup:
[echo] Project Name: HelloCordova
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for HelloCordova...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/res
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/rsObj
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/rsLibs
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-gen
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/classes
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HelloCordova...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Users/joetsuihk/Development/sdk
-setup:
[echo] Project Name: CordovaLib
[gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for CordovaLib...
[gettarget] Project Target: Android 4.4.2
[gettarget] API level: 19
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/res
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/libs
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/res
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/rsObj
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/rsLibs
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-gen
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/classes
[mkdir] Created dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for CordovaLib...
[dependency] Library dependencies:
[dependency] No Libraries
[dependency]
[dependency] ------------------
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
-compile:
[javac] Compiling 89 source files to /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/classes
[javac] Note: Some input files use or override a deprecated API.
[javac] Note: Recompile with -Xlint:deprecation for details.
[echo] Creating library output jar file...
[jar] Building jar: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/classes.jar
-post-compile:
-obfuscate:
-dex:
[echo] Library project: do not convert bytecode...
-crunch:
[crunch] Crunching PNG Files in source dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/res
[crunch] To destination dir: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/res
[crunch] Crunched 0 PNG files to update cache
-package-resources:
[echo] Library project: do not package resources...
-package:
[echo] Library project: do not package apk...
-post-package:
-do-debug:
[echo] Library project: do not create apk...
[propertyfile] Creating new property file: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/build.prop
[propertyfile] Updating property file: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
[echo] ----------
[echo] Handling BuildConfig class...
[buildconfig] Generating BuildConfig class.
-pre-compile:
[echo] Set jars path to: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/CordovaLib/ant-build/classes.jar
-compile:
[javac] Compiling 4 source files to /Users/joetsuihk/iOSprojects/myApp2/platforms/android/ant-build/classes
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:22: package com.facebook does not exist
[javac] import com.facebook.FacebookDialogException;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:23: package com.facebook does not exist
[javac] import com.facebook.FacebookException;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:24: package com.facebook does not exist
[javac] import com.facebook.FacebookOperationCanceledException;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:25: package com.facebook does not exist
[javac] import com.facebook.Request;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:26: package com.facebook does not exist
[javac] import com.facebook.Response;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:27: package com.facebook does not exist
[javac] import com.facebook.Session;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:28: package com.facebook does not exist
[javac] import com.facebook.SessionState;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:29: package com.facebook.model does not exist
[javac] import com.facebook.model.GraphObject;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:30: package com.facebook.model does not exist
[javac] import com.facebook.model.GraphUser;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:31: package com.facebook.widget does not exist
[javac] import com.facebook.widget.WebDialog;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:32: package com.facebook.widget.WebDialog does not exist
[javac] import com.facebook.widget.WebDialog.OnCompleteListener;
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:340: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] private void getUserInfo(final Session session) {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:361: cannot find symbol
[javac] symbol : class SessionState
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] private void onSessionStateChange(SessionState state, Exception exception) {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:62: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = new Session.Builder(cordova.getActivity())
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:62: package Session does not exist
[javac] Session session = new Session.Builder(cordova.getActivity())
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:65: cannot find symbol
[javac] symbol : variable SessionState
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] if (session.getState() == SessionState.CREATED_TOKEN_LOADED) {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:66: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session.setActiveSession(session);
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:68: package Session does not exist
[javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity());
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:68: package Session does not exist
[javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity());
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:70: package Session does not exist
[javac] openRequest.setCallback(new Session.StatusCallback() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:91: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session.getActiveSession().onActivityResult(cordova.getActivity(), requestCode, resultCode, intent);
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:111: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:111: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:147: package Session does not exist
[javac] Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(cordova.getActivity(),
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:147: package Session does not exist
[javac] Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(cordova.getActivity(),
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:164: package Session does not exist
[javac] session = new Session.Builder(cordova.getActivity())
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:167: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session.setActiveSession(session);
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:169: package Session does not exist
[javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity());
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:169: package Session does not exist
[javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity());
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:173: package Session does not exist
[javac] openRequest.setCallback(new Session.StatusCallback() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:188: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:188: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:203: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] callbackContext.success(Session.getActiveSession().getState().toString());
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:206: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:206: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:257: cannot find symbol
[javac] symbol : class OnCompleteListener
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] final OnCompleteListener dialogCallback = new OnCompleteListener() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:257: cannot find symbol
[javac] symbol : class OnCompleteListener
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] final OnCompleteListener dialogCallback = new OnCompleteListener() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:308: cannot find symbol
[javac] symbol: class WebDialog
[javac] WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:308: package WebDialog does not exist
[javac] WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:310: cannot find symbol
[javac] symbol: variable Session
[javac] Session.getActiveSession(),
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:322: cannot find symbol
[javac] symbol: class WebDialog
[javac] WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:322: package WebDialog does not exist
[javac] WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder(
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:324: cannot find symbol
[javac] symbol: variable Session
[javac] Session.getActiveSession(),
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:342: package Request does not exist
[javac] Request.newMeRequest(session, new Request.GraphUserCallback() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:342: cannot find symbol
[javac] symbol : variable Request
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] Request.newMeRequest(session, new Request.GraphUserCallback() {
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:362: cannot find symbol
[javac] symbol : class Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] final Session session = Session.getActiveSession();
[javac] ^
[javac] /Users/joetsuihk/iOSprojects/myApp2/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:362: cannot find symbol
[javac] symbol : variable Session
[javac] location: class org.apache.cordova.facebook.ConnectPlugin
[javac] final Session session = Session.getActiveSession();
[javac] ^
[javac] 47 errors
BUILD FAILED
/Users/joetsuihk/Development/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/joetsuihk/Development/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 2 seconds
Error code 1 for command: ant with args: debug,-f,/Users/joetsuihk/iOSprojects/myApp2/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/joetsuihk/iOSprojects/myApp2/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I have the same problem you are installing on android
I am getting the same error as of joetsuihk posted above. Any guess, what is wrong while building the cordova app? @joetsuihk: Have you got any solution?
I got this error: anand@anand:~/phonegap-projects/locatr$ cordova platform add android Creating android project... Creating Cordova project for the Android platform: Path: platforms/android Package: com.innofied.locatr Name: Locatr Android target: android-19 Copying template files... Running: android update project --subprojects --path "platforms/android" --target android-19 --library "CordovaLib" Resolved location of library project to: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib Updated and renamed default.properties to project.properties Updated local.properties No project name specified, using Activity name 'Locatr'. If you wish to change it, edit the first line of build.xml. Added file platforms/android/build.xml Added file platforms/android/proguard-project.txt Updated project.properties Updated local.properties No project name specified, using project folder name 'CordovaLib'. If you wish to change it, edit the first line of build.xml. Added file platforms/android/CordovaLib/build.xml Added file platforms/android/CordovaLib/proguard-project.txt
Project successfully created. Installing "com.phonegap.plugins.facebookconnect" for android anand@anand:~/phonegap-projects/locatr$ cordova build android Running command: /home/anand/phonegap-projects/locatr/platforms/android/cordova/build Buildfile: /home/anand/phonegap-projects/locatr/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env: [checkenv] Android SDK Tools Revision 22.6.2 [checkenv] Installed at /home/anand/Software/adt-bundle-linux-x86_64-20140321/sdk
-setup: [echo] Project Name: Locatr [gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup: [getbuildtools] Using latest Build Tools: 19.0.3 [echo] Resolving Build Target for Locatr... [gettarget] Project Target: Android 4.4.2 [gettarget] API level: 19 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build/res [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build/rsObj [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build/rsLibs [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-gen [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build/classes [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/ant-build/dexedLibs [echo] ---------- [echo] Resolving Dependencies for Locatr... [dependency] Library dependencies: [dependency] [dependency] ------------------ [dependency] Ordered libraries: [dependency] [dependency] ------------------ [echo] ---------- [echo] Building Libraries with 'debug'...
nodeps:
-set-mode-check:
-set-debug-files:
-check-env: [checkenv] Android SDK Tools Revision 22.6.2 [checkenv] Installed at /home/anand/Software/adt-bundle-linux-x86_64-20140321/sdk
-setup: [echo] Project Name: CordovaLib [gettype] Project Type: Android Library
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup: [getbuildtools] Using latest Build Tools: 19.0.3 [echo] Resolving Build Target for CordovaLib... [gettarget] Project Target: Android 4.4.2 [gettarget] API level: 19 [echo] ---------- [echo] Creating output directories if needed... [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/res [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/libs [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/res [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/rsObj [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/rsLibs [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-gen [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/classes [mkdir] Created dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/dexedLibs [echo] ---------- [echo] Resolving Dependencies for CordovaLib... [dependency] Library dependencies: [dependency] No Libraries [dependency] [dependency] ------------------
-code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.
-pre-compile:
-compile: [javac] Compiling 89 source files to /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/classes [javac] Note: Some input files use or override a deprecated API. [javac] Note: Recompile with -Xlint:deprecation for details. [echo] Creating library output jar file... [jar] Building jar: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/classes.jar
-post-compile:
-obfuscate:
-dex: [echo] Library project: do not convert bytecode...
-crunch: [crunch] Crunching PNG Files in source dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/res [crunch] To destination dir: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/res [crunch] Crunched 0 PNG files to update cache
-package-resources: [echo] Library project: do not package resources...
-package: [echo] Library project: do not package apk...
-post-package:
-do-debug: [echo] Library project: do not create apk... [propertyfile] Creating new property file: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/build.prop [propertyfile] Updating property file: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/build.prop [propertyfile] Updating property file: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/build.prop [propertyfile] Updating property file: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/build.prop
-post-build:
debug:
-code-gen: [mergemanifest] Merging AndroidManifest files into one. [mergemanifest] Manifest merger disabled. Using project manifest only. [echo] Handling aidl files... [aidl] No AIDL files to compile. [echo] ---------- [echo] Handling RenderScript files... [echo] ---------- [echo] Handling Resources... [aapt] Generating resource IDs... [echo] ---------- [echo] Handling BuildConfig class... [buildconfig] Generating BuildConfig class.
-pre-compile: [echo] Set jars path to: /home/anand/phonegap-projects/locatr/platforms/android/CordovaLib/ant-build/classes.jar
-compile: [javac] Compiling 4 source files to /home/anand/phonegap-projects/locatr/platforms/android/ant-build/classes [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:22: error: package com.facebook does not exist [javac] import com.facebook.FacebookDialogException; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:23: error: package com.facebook does not exist [javac] import com.facebook.FacebookException; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:24: error: package com.facebook does not exist [javac] import com.facebook.FacebookOperationCanceledException; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:25: error: package com.facebook does not exist [javac] import com.facebook.Request; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:26: error: package com.facebook does not exist [javac] import com.facebook.Response; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:27: error: package com.facebook does not exist [javac] import com.facebook.Session; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:28: error: package com.facebook does not exist [javac] import com.facebook.SessionState; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:29: error: package com.facebook.model does not exist [javac] import com.facebook.model.GraphObject; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:30: error: package com.facebook.model does not exist [javac] import com.facebook.model.GraphUser; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:31: error: package com.facebook.widget does not exist [javac] import com.facebook.widget.WebDialog; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:32: error: package com.facebook.widget.WebDialog does not exist [javac] import com.facebook.widget.WebDialog.OnCompleteListener; [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:340: error: cannot find symbol [javac] private void getUserInfo(final Session session) { [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:361: error: cannot find symbol [javac] private void onSessionStateChange(SessionState state, Exception exception) { [javac] ^ [javac] symbol: class SessionState [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:62: error: cannot find symbol [javac] Session session = new Session.Builder(cordova.getActivity()) [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:62: error: package Session does not exist [javac] Session session = new Session.Builder(cordova.getActivity()) [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:65: error: cannot find symbol [javac] if (session.getState() == SessionState.CREATED_TOKEN_LOADED) { [javac] ^ [javac] symbol: variable SessionState [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:66: error: cannot find symbol [javac] Session.setActiveSession(session); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:68: error: package Session does not exist [javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity()); [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:68: error: package Session does not exist [javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity()); [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:70: error: package Session does not exist [javac] openRequest.setCallback(new Session.StatusCallback() { [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:91: error: cannot find symbol [javac] Session.getActiveSession().onActivityResult(cordova.getActivity(), requestCode, resultCode, intent); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:111: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:111: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:147: error: package Session does not exist [javac] Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(cordova.getActivity(), [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:147: error: package Session does not exist [javac] Session.NewPermissionsRequest newPermissionsRequest = new Session.NewPermissionsRequest(cordova.getActivity(), [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:164: error: package Session does not exist [javac] session = new Session.Builder(cordova.getActivity()) [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:167: error: cannot find symbol [javac] Session.setActiveSession(session); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:169: error: package Session does not exist [javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity()); [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:169: error: package Session does not exist [javac] Session.OpenRequest openRequest = new Session.OpenRequest(cordova.getActivity()); [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:173: error: package Session does not exist [javac] openRequest.setCallback(new Session.StatusCallback() { [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:188: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:188: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:203: error: cannot find symbol [javac] callbackContext.success(Session.getActiveSession().getState().toString()); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:206: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:206: error: cannot find symbol [javac] Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:257: error: cannot find symbol [javac] final OnCompleteListener dialogCallback = new OnCompleteListener() { [javac] ^ [javac] symbol: class OnCompleteListener [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:257: error: cannot find symbol [javac] final OnCompleteListener dialogCallback = new OnCompleteListener() { [javac] ^ [javac] symbol: class OnCompleteListener [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:308: error: cannot find symbol [javac] WebDialog feedDialog = (new WebDialog.FeedDialogBuilder( [javac] ^ [javac] symbol: class WebDialog [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:308: error: package WebDialog does not exist [javac] WebDialog feedDialog = (new WebDialog.FeedDialogBuilder( [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:310: error: cannot find symbol [javac] Session.getActiveSession(), [javac] ^ [javac] symbol: variable Session [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:322: error: cannot find symbol [javac] WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder( [javac] ^ [javac] symbol: class WebDialog [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:322: error: package WebDialog does not exist [javac] WebDialog requestsDialog = (new WebDialog.RequestsDialogBuilder( [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:324: error: cannot find symbol [javac] Session.getActiveSession(), [javac] ^ [javac] symbol: variable Session [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:342: error: package Request does not exist [javac] Request.newMeRequest(session, new Request.GraphUserCallback() { [javac] ^ [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:342: error: cannot find symbol [javac] Request.newMeRequest(session, new Request.GraphUserCallback() { [javac] ^ [javac] symbol: variable Request [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:362: error: cannot find symbol [javac] final Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: class Session [javac] location: class ConnectPlugin [javac] /home/anand/phonegap-projects/locatr/platforms/android/src/org/apache/cordova/facebook/ConnectPlugin.java:362: error: cannot find symbol [javac] final Session session = Session.getActiveSession(); [javac] ^ [javac] symbol: variable Session [javac] location: class ConnectPlugin [javac] 47 errors
BUILD FAILED /home/anand/Software/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:720: The following error occurred while executing this line: /home/anand/Software/adt-bundle-linux-x86_64-20140321/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.
Total time: 6 seconds Error code 1 for command: ant with args: debug,-f,/home/anand/phonegap-projects/locatr/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen Error: /home/anand/phonegap-projects/locatr/platforms/android/cordova/build: Command failed with exit code 2 at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:126:23) at ChildProcess.EventEmitter.emit (events.js:98:17) at maybeClose (child_process.js:753:16) at Process.ChildProcess._handle.onexit (child_process.js:820:5) anand@anand:~/phonegap-projects/locatr$
@anandasansol you need to run cordova build
this is required in Cordova 3.4.x it will setup and build the jar in the CordovaLib sub project.
@confile have you resolved this issue?
@confile I also facing same error anyone here resolve that?
After almost a day I got the build to work - had the same error like @confile
After adding the FacebookLib to the project in Eclipse I did the following:
platforms/android
android update project -p FacebookLib
platforms/android
folder with the following command: ant clean
cordova build android
in the project folder -> BUILD SUCCESSFULLAlso running the App works, but unfortunately it crashes when I try to call the facebook login. What I do not understand is, that everything works fine (build/run/login) when I run the project in Eclipse.
@Rautec I have the exact same problem when it comes to run the application on devices (tested with two phones, HTC One M7 4.4.2, Google Nexus 5 4.4.3).
I had trouble with the building step at first but I can't get through this issue. Don't know why it crashes... :/
When I call showDialog it cashes too. When I call api or getLoginStatus it responds null (which is correct since I'm not logged in) When I call getAccessToken or logout it responds "No valid session found, must call init and login before logout". (which is correct)
login: function () {
facebookConnectPlugin.login( ["email"],
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
},
showDialog: function () {
facebookConnectPlugin.showDialog( { method: "feed" },
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
},
apiTest: function () {
facebookConnectPlugin.api( "me/?fields=id,email", ["user_birthday"],
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
},
getAccessToken: function () {
facebookConnectPlugin.getAccessToken(
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
},
getStatus: function () {
facebookConnectPlugin.getLoginStatus(
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
},
logout: function () {
facebookConnectPlugin.logout(
function (response) { alert(JSON.stringify(response)) },
function (response) { alert(JSON.stringify(response)) });
}
He are the logs from logcat (pid 1339):
W/asset ( 1339): Copying FileAsset 0x741dc190 (zip:/data/app/io.cordova.hellocordova-1.apk:/resources.arsc) to buffer
I/CordovaLog( 1339): Changing log level to DEBUG(3)
I/CordovaLog( 1339): Found start page location: index.html
D/Whitelist( 1339): Unlimited access to network resources
D/CordovaActivity( 1339): CordovaActivity.onCreate()
E/memtrack( 1321): Couldn't load memtrack module (No such file or directory)
E/android.os.Debug( 1321): failed to load memtrack module: -2
V/WebViewChromium( 1339): Binding Chromium to the background looper Looper (main, tid 1) {4234cb58}
I/chromium( 1339): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0
I/BrowserProcessMain( 1339): Initializing chromium process, renderers=0
W/chromium( 1339): [WARNING:resource_bundle.cc(252)] locale_file_path.empty()
E/chromium( 1339): [ERROR:resource_bundle.cc(532)] Failed to load /data/data/io.cordova.hellocordova/app_webview/paks/we
bviewchromium.pak
E/chromium( 1339): Some features may not be available.
W/chromium( 1339): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation
I/Adreno-EGL( 1339): <qeglDrvAPI_eglInitialize:316>: EGL 1.4 QUALCOMM build: (CL4169980)
I/Adreno-EGL( 1339): OpenGL ES Shader Compiler Version: 17.01.10.SPL
I/Adreno-EGL( 1339): Build Date: 12/25/13 Wed
I/Adreno-EGL( 1339): Local Branch:
I/Adreno-EGL( 1339): Remote Branch:
I/Adreno-EGL( 1339): Local Patches:
I/Adreno-EGL( 1339): Reconstruct Branch:
D/CordovaWebView( 1339): CordovaWebView is running on device made by: HTC
D/JsMessageQueue( 1339): Set native->JS mode to 2
D/CordovaActivity( 1339): CordovaActivity.init()
D/CordovaWebView( 1339): >>> loadUrl(file:///android_asset/www/index.html)
D/PluginManager( 1339): init()
D/CordovaWebView( 1339): >>> loadUrlNow()
W/chromium( 1339): [WARNING:resource_bundle.cc(340)] Unable to load image with id 5646
I/CordovaLog( 1339): Changing log level to DEBUG(3)
I/CordovaLog( 1339): Found start page location: index.html
D/Whitelist( 1339): Unlimited access to network resources
D/CordovaActivity( 1339): Resuming the App
D/CordovaActivity( 1339): CB-3064: The errorUrl is null
D/SoftKeyboardDetect( 1339): Ignore this event
I/InputMethodManagerService( 901): Disable input method client, pid=1299
W/ResourceType( 1339): No package identifier when getting name for resource number 0x00000064
I/InputMethodManager( 1339): [startInputInner] EditorInfo { packageName=io.cordova.hellocordova, inputType=0xa1, imeOpti
ons=0x12000000, privateImeOptions=null }, windowGainingFocus=android.view.ViewRootImpl$W@4239b440, mServedView=org.apach
e.cordova.CordovaWebView{42363e90 IFEDH.C. .F....I. 0,0-1080,1845 #64}
D/SoftKeyboardDetect( 1339): Ignore this event
I/InputMethodManagerService( 901): Enable input method client, pid=1339
I/ActivityManager( 901): Displayed io.cordova.hellocordova/.HelloCordova: +441ms (total +5m21s43ms)
D/CordovaWebViewClient( 1339): onPageStarted(file:///android_asset/www/index.html)
D/CordovaActivity( 1339): onMessage(onPageStarted,file:///android_asset/www/index.html)
D/PMS ( 901): releaseWL(43a0ecd8): PARTIAL_WAKE_LOCK ActivityManager-Launch 0x1
D/CordovaLog( 1339): file:///android_asset/www/index.html: Line 25 : Viewport target-densitydpi is not supported.
I/chromium( 1339): [INFO:CONSOLE(25)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/
index.html (25)
D/CordovaWebViewClient( 1339): onPageFinished(file:///android_asset/www/index.html)
D/CordovaActivity( 1339): onMessage(onPageFinished,file:///android_asset/www/index.html)
D/CordovaActivity( 1339): onMessage(spinner,stop)
I/chromium( 1339): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
I/chromium( 1339): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
E/qdutils ( 1339): FBIOGET_FSCREENINFO failed
D/CordovaLog( 1339): file:///android_asset/www/js/index.js: Line 47 : Received Event: deviceready
I/chromium( 1339): [INFO:CONSOLE(47)] "Received Event: deviceready", source: file:///android_asset/www/js/index.js (47)
D/ConnectPlugin( 1339): login FB
I/Venom ( 1339): Action mTweaksNewTask: 0
WI/ActivityManager( 901): START u0 {act=SSO_WITH_FALLBACK cmp=io.cordova.hellocordova/com.facebook.LoginActivity (has ex
tras)} from pid 1339
D/PMS ( 901): acquireWL(43411868): PARTIAL_WAKE_LOCK ActivityManager-Launch 0x1 901 1000
D/CordovaActivity( 1339): Paused the application!
D/CordovaWebView( 1339): Handle the pause
W/chromium( 1339): [WARNING:resource_bundle.cc(340)] Unable to load image with id 5646
W/PluginManager( 1339): THREAD WARNING: exec() call to FacebookConnectPlugin.login blocked the main thread for 170ms. Pl
ugin should use CordovaInterface.getThreadPool().
W/dalvikvm( 1339): threadid=1: thread exiting with uncaught exception (group=0x41f146f8)
E/ActivityManager( 901): App crashed! Process: io.cordova.hellocordova
E/AndroidRuntime( 1339): FATAL EXCEPTION: main
E/AndroidRuntime( 1339): Process: io.cordova.hellocordova, PID: 1339
E/AndroidRuntime( 1339): java.lang.NoClassDefFoundError: com/facebook/android/R$layout
E/AndroidRuntime( 1339): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
E/AndroidRuntime( 1339): at android.app.Activity.performCreate(Activity.java)
E/AndroidRuntime( 1339): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java)
E/AndroidRuntime( 1339): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java)
E/AndroidRuntime( 1339): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java)
E/AndroidRuntime( 1339): at android.app.ActivityThread.access$800(ActivityThread.java)
E/AndroidRuntime( 1339): at android.app.ActivityThread$H.handleMessage(ActivityThread.java)
E/AndroidRuntime( 1339): at android.os.Handler.dispatchMessage(Handler.java)
E/AndroidRuntime( 1339): at android.os.Looper.loop(Looper.java)
E/AndroidRuntime( 1339): at android.app.ActivityThread.main(ActivityThread.java)
E/AndroidRuntime( 1339): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 1339): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime( 1339): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java)
E/AndroidRuntime( 1339): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java)
E/AndroidRuntime( 1339): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:126)
E/AndroidRuntime( 1339): at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 1339): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.android.R$layout"
on path: DexPathList[[zip file "/data/app/io.cordova.hellocordova-1.apk"],nativeLibraryDirectories=[/data/app-lib/io.cor
dova.hellocordova-1, /vendor/lib, /system/lib]]
E/AndroidRuntime( 1339): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
E/AndroidRuntime( 1339): at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
E/AndroidRuntime( 1339): at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
E/AndroidRuntime( 1339): ... 16 more
D/libc ( 1339): [NET] getaddrinfo+,hn 18(0x67726170682e66),sn(),family 0,flags 4
D/libc ( 1339): [NET] getaddrinfo-,err=8
D/libc ( 1339): [NET] getaddrinfo+,hn 18(0x67726170682e66),sn(),family 0,flags 1024
D/libc ( 1339): [NET] getaddrinfo-, 1
D/libc ( 1339): [NET] getaddrinfo_proxy+
D/libc ( 1339): [NET] getaddrinfo+,hn 18(0x67726170682e66),sn(),family 0,flags 4
D/libc ( 1339): [NET] getaddrinfo-,err=8
D/libc ( 1339): [NET] getaddrinfo+,hn 18(0x67726170682e66),sn(),family 0,flags 1024
D/libc ( 1339): [NET] getaddrinfo-, 1
D/libc ( 1339): [NET] getaddrinfo_proxy+
D/libc ( 1339): [NET] getaddrinfo_proxy-, success
D/libc ( 1339): [NET] getaddrinfo_proxy-, success
The application is empty, I followed the exact steps of the README.md.
I'm on Windows 7, using : Java JRE 6 (tested with 8, same issue) Java SDK 1.6.0_45 (tested with 1.8.0_45, same issue) Eclipse Kepler Service Release 2 (only for adding FacebookLib as a depedency) Powershell Cordova 3.5.0-0.2.4 phonegap-facebook-plugin (test with master AND develop, same issue)
Does anyone have a clue ?
Edit : Below a screenshot of my project properties in Eclipse
I have the same issue with the app crashing. Same as @Rautec and @Cornik34.
E/AndroidRuntime(29743): java.lang.NoClassDefFoundError: com.facebook.android.R$layout
E/AndroidRuntime(29743): at com.facebook.LoginActivity.onCreate(LoginActivity.java:57)
E/AndroidRuntime(29743): at android.app.Activity.performCreate(Activity.java:5426)
E/AndroidRuntime(29743): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1105)
E/AndroidRuntime(29743): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2269)
E/AndroidRuntime(29743): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2363)
E/AndroidRuntime(29743): at android.app.ActivityThread.access$900(ActivityThread.java:161)
E/AndroidRuntime(29743): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1265)
E/AndroidRuntime(29743): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(29743): at android.os.Looper.loop(Looper.java:157)
E/AndroidRuntime(29743): at android.app.ActivityThread.main(ActivityThread.java:5356)
E/AndroidRuntime(29743): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(29743): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(29743): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1265)
E/AndroidRuntime(29743): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1081)
E/AndroidRuntime(29743): at dalvik.system.NativeStart.main(Native Method)
Any ideas please?
Edit: Some further information (but no real solution) here: https://github.com/phonegap/phonegap-facebook-plugin/issues/432
I had the same with cordova 3.3 [linux environment]
I managed to build by:
installing the plugin cordova plugin add https://github.com/phonegap/phonegap-facebook-plugin.git --variable APP_ID="yourvalues" --variable APP_NAME="yourvalues"
going in the android platform folder cd platforms/android
add this line to project.properties android.library.reference.2=FacebookLib
update the project android update project --subprojects --path . --target "android-19"
Then I can compile using cordova build
hopefully this can help someone
+### Android Setup without Eclipse (just CLI)
+Follow the steps above:
open -e AndroidManifest.xml
// change your minSdkVersion and your targetSdkVersion to your environment settings.
With this steps you can add the Plugin without using Eclipse
Thanks @mainalikishan fot linking my pull request #526 here ;)
Thanks @dawez and @mainalikishan. I got the plugin working using your step-by-step instructions. It's funny as I had been doing almost the same thing for hours the other day, I guess I must have done something wrong somewhere. Glad to have FB auth added to my app properly now.
Thanks @mainalikishan.
After following the steps, I was getting this error with ant release
and build commands –
/Applications/ADT/sdk/tools/ant/build.xml:542: Unable to resolve project target 'android-8'
Solved it by searching for all the files with "android-8" string (with grep "android-8" -r ./
) and replacing "8" with the API version I'm using in the project (19).
Guys! Please send PRs to develop!! Gives us more testing time and a change to roll back if something goes wrong!
cc: @sebastianzillessen
Thanks @rautec! Was having the same problem (though with Ionic) and after following your steps I was able to build!
Instructions for non-Eclipse workflow have been added.
Closing.
I did these steps:
After that I did cordova build but I get the following error: