phonegap facebook connect integration issue - android

I am trying to integrate my phonegap application with facebook through facebook connect plugin. I followed the instructions here since git wasn't working for me but I think I would end up with the exact same setup either way.
When I run the following code after doing FB.init() using my app ID, I get an alert saying "Cordova Facebook Connect Plugin failed on auth.status"
console.log('Debug 1');
var params = {
method: 'feed',
name: 'Facebook Dialogs',
link: 'https://developers.facebook.com/docs/reference/dialogs/',
picture: 'http://fbrell.com/f8.jpg',
caption: 'Reference Documentation',
description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'
};
console.log(params);
FB.ui(params, function(obj) { console.log(obj);});
While logcat output shows this:
09-03 21:29:00.230: D/CordovaLog(21824): Error: Status=2 Message=Class not found
09-03 21:29:00.230: D/CordovaLog(21824): file:///android_asset/www/cordova-2.0.0.js: Line 938 : Error: Status=2 Message=Class not found
09-03 21:29:00.230: I/Web Console(21824): Error: Status=2 Message=Class not found at file:///android_asset/www/cordova-2.0.0.js:938
I don't know if this is an issue with facebook authentication of my app or some code issue. I have generated an Android Hash Key using the keytool and submitted it to facebook developer page. When I export my android project as android application in eclipse using the same keystore, it doesn't show me the alias I used with keytool (same keystore). So I created a new alias with the same alias name and password and then install the apk on my phone. What seems to be the issue here?

Well there were many problems. First of all, and most confusing was that the following line is not to be placed in plugins.xml but in config.xml instead.
<plugin name="com.phonegap.facebook.Connect" value="com.phonegap.facebook.ConnectPlugin" />
After that, I had not entered the correct hash key at facebook developer page. Since you don't want to export an apk through a keystore every time you need to test your app, you should just run the debugging apk generated by eclipse (Run as > Android application) and attempt FB.login(). Facebook will give you an error that your key is 'xxxxxx' and it does not match the keys listed at your app page. Note 'xxxxxxx' down and enter it on the facebook app page.
Others were my own mistakes of not including the scripts in the correct order. I had not followed the example carefully. Be sure you get the example/Simple/index.html working first before you code for your own application. Hope it helps...

Related

amplify init fails constantly

I don't know whats really wrong with my amplify. I run amplify init and get this error message. I have downloaded my amplify cli using npm and have successfully run 'amplify configure'.
init failed
InvalidSignatureException: The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.
The Canonical String for this request should have been
'POST
/apps
host:amplify.ap-south-1.amazonaws.com
x-amz-content-sha256:79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29
x-amz-date:20210121T154050Z
host;x-amz-content-sha256;x-amz-date
79ec4b759220a7b1d454721bb2c7e1350dccbd691853e5ed1b3c92bec21dbc29'
The String-to-Sign should have been
'AWS4-HMAC-SHA256
20210121T154050Z
20210121/ap-south-1/amplify/aws4_request
b150344845c2c575fd957d63172173a367f2bacf0e817764a02e5b20d03c3811'
Okay, so I finally found out what was bugging me for last three days. A whitespace ( ).
Yes!
I had my folder inside the user with a whitespace in it, as in "First Last". Instead what I should have done is changed my folder name inside my C:\Users\First Last to C:\Users\FirstLast before starting, and then try to install my amplify CLI using the command curl -sL https://aws-amplify.github.io/amplify-cli/install-win -o install.cmd && install.cmd and proceed as mentioned in the documentation here.
To change the name of the User folder in windows 10, I watched this great YT! video
On Mac:
I was also getting the same error while using the aws amplify CLI tool in my nodejs project.
Like #miraquee noted above about the issue being a white space. I suspected that I also had the same issue. What I did to start clean was:
Delete the local .aws folder in my home folder on mac to start clean
rm -rf ~/.aws/
Ran amplify init again. This time when reaching the step where it asks you to create an IAM user, which subsequently takes opens your web browser to finish the creation of the new IAM user, I was very careful about copying in the Access Key Id and Secret Access Key
This time when I went through the flow in the CLI it worked.
If you want to see a video of these steps, checkout this YouTube video built by one of the engineers on the AWS amplify team
Youtube video link: https://www.youtube.com/watch?v=fWbM5DLh25U

Ionic 3 Google Login

I'm trying to integrate The Ionic Google Plus Native Plugin to allow users to log into my app from their phone using Google Login. This is just a wrapper around this Cordova / PhoneGap library.
I think I'm just about all the way there. I have a button on my login screen and when I click it on my Android phone, I am confronted with the expected "Choose an account" screen. But when I actually do tap on one of my accounts and look at what happened in Chrome Dev Tools (by way of Remote Debugging), I see that an error resulted, cryptically denoted 12500 with a useless stack-trace.
It seems that a handful of stars need to align to get this to work, and it's not entirely clear how I can get this to work concurrently in Development and Production modes. Here's what I've checked:
In Google APIs & Services => Credentials dashboard
I have two OAuth 2.0-client IDs for Android, one is meant for Development and one is meant for Production.
Both of these are configured with the same Package name, which is the fully qualified name in the Android manifest file, named starting with "com.blah.blah.blah" which is also the widget id in the config.xml file
Each of these is configured with a different Signing-certificate fingerprint, which I established using keytool.
For Production, I generated the SHA1 fingerprint from the keystore file I use to sign the app for production.
For Development, I generated the SHA1 fingerprint by extracting the debug APK generated by ionic cordova run android, and running keytool on the contained META-INF/CERT.RSA file.
In the Ionic project's config.xml file
I have a section that looks like this:
<plugin name="cordova-plugin-googleplus" spec="^5.3.2">
<variable name="REVERSED_CLIENT_ID" value="com.googleusercontent.apps.ABCDEFG-12345" />
<variable name="WEB_APPLICATION_CLIENT_ID" value="ABCDEFG-12345.apps.googleusercontent.com" />
<variable name="PLAY_SERVICES_VERSION" value="11.8.0" />
</plugin>
I've been substituting for ABCDEFG-12345 above the Production or Development unique client id part there, I don't see a clear way to support both at once except maybe as a custom build step.
In the Typescript for the page with my login button, for now, I'm just doing this:
import { GooglePlus } from '#ionic-native/google-plus
...
constructor(public googlePlus: GooglePlus){}
...
login() {
this.googlePlus.login({
webClientId: 'ABCDEFG-12345.apps.googleusercontent.com',
offline: false
})
.then(res => console.log(res))
.catch(err => console.error(err));
}
Again here, substituting ABCDEFG-12345 above the Production or Development unique client id part there, I don't see a clear way to support both at once except maybe as a custom build step.
When I tap the button, I just get the 12500 error in Development mode. I haven't tried in Production mode. What the heck am I missing and how do I get to the bottom of it?
Cross-posted issue in github repository here.
UPDATE: 7 NOV 2018
Omitting all options from the call to this.googlePlus.login (that is, passing an empty object, {}) I don't get the error, but this.googlePlus.login, I get back a user object in response. However, I do not get back (at least on Android) an idtoken (which I can pass to my server-side code). So my object looks like this:
{
accessToken: "XXXXXXXXXXX"
displayName: "XXXXXXXXXXX"
email: "XXXXXXXXXXX"
expires: XXXXXXXXXXX
expires_in: XXXXXXXXXXX
familyName: "XXXXXXXXXXX"
givenName: "XXXXXXXXXXX"
userId: "XXXXXXXXXXXX"
}
Any ideas how to get an idtoken in the callback object?

Why do I get com.google.android.gms.common.api.ApiException: 10:?

private void handleSignInResult(Task<GoogleSignInAccount> completedTask) {
try {
GoogleSignInAccount account = completedTask.getResult(ApiException.class); //exception is here
// Signed in successfully, show authenticated UI.
System.out.println("google token ---> " + account.getIdToken());
} catch (ApiException e) {
// The ApiException status code indicates the detailed failure reason.
// Please refer to the GoogleSignInStatusCodes class reference for more information about this error.
e.printStackTrace();
}
}
Quoting the documentation:
Certain Google Play services (such as Google Sign-in and App Invites)
require you to provide the SHA-1 of your signing certificate so we can
create an OAuth2 client and API key for your app.
If you are using Firebase and try on the debug app :
1. First, get your SHA-1 debug key :
Click on Gradle (From Right Side Panel, you will see Gradle Bar)
Click on Tasks
Click on Android
Double Click on signingReport (You will get SHA-1 and MD5)
2. Add your key to your Firebase project :
Go to Project settings -> SHA certificate fingerprints -> Add SHA-1 key of debug app.
Then you can update your google-services.json file in your Android project.
Its works for me.
This status code means that you are providing unknown server client id.
In https://console.developers.google.com/apis/credentials in your project you might need to generate: OAuth client ID -> Web Application and use this web application client id here:
val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(webApplicationClientId)
.requestEmail()
.build()
I have solved this problem using these steps:
1). Goto https://console.developers.google.com/ and delete (Android Client) if it is created.
2). Click on Create Credential and click on OAuthClientID and select android
3). copy and paste your SHA 1 fingerprint
4). type your package name then saved
5). Goto console.firebase.com
6). download google-service.json move it into your project into app directory
7). Open google-service.json and find out client id type 3 and use it as default_web_client_id
8). Run your App
I have this thing in 2-3% of the occasions in production and it works seamlessly for everyone else.
Given the sheer amount of problems and differing answers this is causing, it's fair to say that this is a problem on behalf of firebase. They've implemented a catch-all error routine that is just bad api design. The api must point to the problem where it fails.
A long term solution is to convince firebase that this is bad-api design and they need to do better.
We're strong together.
Please write a support ticket to firebase roughly with this:
Hey Firebase Support,
i have a com.google.android.gms.common.api.ApiException: 10 in my app.
The problem for me - and for a lot of people all over the forums - is
that your api seems to have a catch-all error routine that roughly
speaking is saying "something went wrong, please fix it".
You could release your support team and a lot of people from headache
if you would fix this.
The API should be able to figure what's wrong and give a better error
message from the context where it occurs.
It's really a burden and I think that since firebase has a
quasi-monopoly on these matter on Android it's your obligation to do
better.
While this is obviously not your fault, I'd like to encourage you to
escalate this problem.
It's fundamentally bad api design and harms an otherwise great
product.
Thanks anyway.
My problem was trying to use Google Sign-In yet I had accidentally enter the wrong SHA1 in Firebase. Try running Gradle > Your app name > Tasks > android > signingReport, get your SHA1 key and compare it with the one on Firebase. If they are different, change the Firebase SHA1 key to match the one you got from the signingReport. Don't forget to also download the google-services.json afterwards.
The ApiException Error Code 10 is a developer error. You get this error when your firebase app is not well configured. One sure case is when you do not supply the SHA1 fingerprint for your android app when you want to use Firebase authentication with Google Signin. (It is a requirement for Google Signin).
So supply the SHA1 fingerprint, download the google-services.json configuration file to your app folder and build. You should be good to go.
Google sign-in is automatically configured on your connected iOS and web apps. To set up Google sign-in for your Android apps, you need to add the SHA1 fingerprint for each app on your Project Settings.
Check this out Common Status Error Codes
In my case the problem was with the SHA1 and google-services.json file
i solved the problem follow this steps:
1.- Open https://console.cloud.google.com/apis/credentials and delete file at OAuth 2.0 Client IDs
2.- Open https://console.firebase.google.com/ clic gear icon -> Proyect Settings -> Select your Android App -> add fingerprint -> save -> and download google-services.json file
3.- Open your android proyect and replace de google-services.json file -> clic Sync Proyect with Gradle Files
4.- The new default_web_client_id at values works fine for me and solved the problem
that is because you are using the wrong default_client_token_id.
to solve this go to the JSON file downloaded from firebase and open it:
your client_id is located right after the
"certificate_hash":xxxxxxzxzxzzzxzxzxzxzxzx....
good luck :) and I hope it helped.
Don`t forget to add
<application
...
<meta-data
android:name="com.google.android.gms.wallet.api.enabled"
android:value="true" />
...
</application>
under your manifest file application tag.
In my case problem was because of absent this lines.
ApiException 10 is a DEVELOPER_ERROR, which means something's wrong with your app configuration.
This answer worked for me, but then I realized our app authenticates with a backend server. So, if your app authenticates with a backend server, you only need to use the web application client ID. But you still need to create client ID of Android type or you're going to get ApiException 12500 . You can read more about it from the documentation. (note that the link has authuser=0)
If you remove this line it will work:
System.out.println("google token ---> " + account.getIdToken());
This is because you don't have the request to the idToken:
.requestIdToken(getString(R.string.google_app_id))
where the app_id will have the value of "OAuth client ID -> Web Application"
When you are doing setup of google login, it normally take Signed keystore hash key. So try with signed APK then it will work. For debugging try to add your debug SHA key on google console.
I guess the question is answered. But for me it was a little different. So
if some googlers come along this and may have the same problem as I had:
Special Case
multiple firebase projects
client ids whitelisted
installed app through app sharing can't sign up with google
In case anybody is using multiple firebase projects for one application (i.e. for different flavors) and has whitelisted the "external" client ID in Google-Authentication in one project.
Then the solution is, to generate new credentials in the Google APIs console of the "master" / whitelisted project with the sha-1 (found in app sharing) of the other project.
Add new credentials to API Console
Go to Google APIs of whitelisted project
Create new OAuth Client ID
Add everything needed, also package name of other project
Paste the SHA-1 hash from App Sharing of other project
Done
Sorry for my bad english. It's not my mother tongue.
This Error because of Wrong Client Id
GoogleSignInOptions googleSignInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(getString(R.string.default_web_client_id))
.requestEmail()
.build();
You must pass your server's client ID to the requestIdToken method.
client Id can be found eaisly in google-services.json file
{
"client_id": "",
"client_type": 3
}
No need to go to Credentials page in the GCP Console.
Please to follow instructions from
https://firebase.google.com/docs/auth/android/google-signin
If you came here because of an error with the Google Login iOS & Android Unity library, this is what helped for me.
I changed the Google project and kept getting ApiException: 10. I later found out that it was because you need to use a web client, not an Android one.
If you want to check if you have a web client or an Android one, open the client_secret_(some text).apps.googleusercontent.com.json file - if it starts with {"web" it's a web client.
Step by step instructions for replacing the client:
Remove the client_secret_(some text).apps.googleusercontent.com.json file from your Unity project. If you have a plist file (for iOS) too, don't remove it.
Go here, click "Configure a project" and configure an Android client.
Go to the Google Cloud Credentials page (select your project if necessary), download the auto-generated web client and place it in your project.
Click Assets > External Dependency Manager > Android Resolver > Force Resolve.
Change the client ID passed to LCGoogleLoginBridge.InitWithClientID in the script where you call this function.
Build and see if the issue has been resolved.
val gso = GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
.requestIdToken(OAUTH_2_CLIENT_ID)
.requestEmail()
.build()
val mGoogleSignInClient = GoogleSignIn.getClient(this, gso)
val signInIntent = mGoogleSignInClient.signInIntent
startActivityForResult(signInIntent, GOOGLE_LOGIN)
OAUTH_2_CLIENT_ID is Web client (auto created by Google Service). Not Android
If you don't use your own backend server you don't need to provide OAuth 2.0 client id (as it said here). Of course check that you provided correct SHA-1 code, but remember that you are providing the release variant SHA-1 key, so this error might appear when you are trying to use Google SignIn with debug app variant. So you have 2 options:
Build and run release APK
Add your debug SHA-1 key to the Firebase console and then you'll be able to run your debug APK without this exception
Possible solve:
If you once renamed project's package check that package name in AndroidManifest.xml and applicationId in app gradle file are the same.
It helped me when I named applicationId like my application package
From my experience it is a problem with SHA1. Solution which worked for me:
Delete OAuth listings if you have created any (probably optional)
Launch this command in your project terminal keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android and copy SHA1 fingerprint.
Go to Firebase console, click gear on your project and delete old fingerprint's. Replace them with the one you copied during step 2
Download new google-services.json file and replace the old one
Sync project with Gradle files.
Should be working :)
I was facing the same issue. I was using SHA-1 credentials. But the problem was that I was directly installing the app to the testing device by using the Run button of Android Studio. In this way, I hadn't defined the debug keystore in Android Studio with which I had created the SHA-1 fingerprint.
To set the debugKeyStore Where is debug.keystore in Android Studio
In my case, it resolved by reconnect my Android Studio to Firebase.
I was getting the same error but I obtained the web client token from Google Cloud Console and placed it right where the GoogleSignInOptions is declared. Replace the
.requestIdToken("getString(R.string.default_web_client_id)")
with the web client ID for your particular Google Cloud project.
I were using this command from documentation ...
keytool -exportcert -keystore ~/.android/debug.keystore -list -v
i just change it to
keytool -exportcert -keystore ./.android/debug.keystore -list -v
and using SHA-1 and copy it into firebase android section.
it just wokrs fine.
For me the mistake was simple. I had initialized google signin options outside the oncreate callback.
If using Google Internal Sharing for testing, make sure to add also the SHA string of your internal sharing (Setup - Internal App sharing in Google Play Console)
I solve this problem by redo my Firebase Auth connection again.
Click the right top little square to login to your google account
Go to the Tool - > Firebase
Select the Authentication
Connect
After that it may say you are already connect, but you need to update the connection. After that it works fine. I think sometime Android Studio mixed up with different Firebase account.

"An internal error occurred" with integration of Google Plus Login

I am trying to integrate a Google plus Login in my application as per the instruction provided by following link :
https://developers.google.com/+/quickstart/android#install-sdk
I am following all the instructions perfectly. And when I run the sample application on a real device provided in the android-sdk and click the signin button, it display a Toast message that An internal error occurred
What am I doing wrong?
I have this problem and even after creating 10 different client IDs with different SHA and package name, it doesn't work... until I found out that you have to fill the Consent screen.
According to GoogleDevelopers Console -
The consent screen will be shown to users whenever you request access
to their private data using your client ID.
This can happen when you haven't set the signature for the client ID in your API console project, or if you copied the wrong key value from keytool. Doing so is documented in the steps of the quick start guide on steps 7, 8, 9, and 10.
I've solved problem by removing .setScopes("PLUS_LOGIN") in the PlusClient.Builder.
I got this toast message error in my android application:
An internal error occurred
Summary:
Assuming you made a mistake configuring the negotiation between your android app and the Android API server granting you access. Most likely caused by you not adding the correct package name or correct SHA1 fingerprint. I followed these steps to blow out the wrong configuration and do it right.
Steps to fix:
Go to your google api console and login: https://code.google.com/apis/console
Click "API Access" tab.
Click the button: "Create another client ID".
Choose: "Installed Application" radio button.
Choose: "Android" radio button.
Enter the package name of the android app that is displaying the above error. You can find it defined at the top of the PlusSampleActivity.java code file. For me it is com.google.android.gms.samples.plus
Acquire your SHA1 fingerprint value:
a. Use the command keytool -list -v -keystore /home/el/.android/debug.keystore. Enter password, If you never set it, the default password is 'android'.
b. The SHA1 fingerprint is shown on screen, copy that.
Paste the above value into the "Signing certificate fingerprint (SHA1):" box.
Click the button: "Create client ID".
Run your android application again, click "Sign in".
Now you are presented with an Activity to "Sign in to Google+ SDK with Google".
In my case, the solution was to actually set an email address in the Consent Screen.
First, I was a bit reluctant to select my personal address and for an strange reason you can save the form without this piece of data with no error. After checking what others have suggested, as soon as I set my email address in that form, it started working.
I have been searching how to fix this for a day with full of research without luck finally i managed
to resolve this issue with the following approach.
Before i begin resolving this (at least how ti worked for me) i have to say that everything on the
documentation is correct and you don't have to change any lines of code or so.
It looks like more of a bug in the https://cloud.google.com/console cloud console
First ensure you got the correct SHA1 and your project's package name as described in the docs
https://developers.google.com/+/quickstart/android
Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created
was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id
like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google.
How to Fix
Go to your cloud console
Make a new project i would suggest a name like
oldprojectname-gplus
In APIs section enable Google+ API
Ensure that none of your projects has the same package name on
OAuth Client ID with the one you will use now otherwise you will get Error This client ID is globally unique and is already in use.(you will have to delete the old OAuth client id with the same package name you will use now).
Go to Credentials Create New Client ID for OAuth.
Installed application
Android
Enter your project's package name and your SHA1
Done
My solution to the problem was following.
I did everything others recommended and there was no typo regarding the package name and SHA1 key. I also tried removing the key and then adding it again but it didn't help.
What did help is removing the key and creating a new project (at https://code.google.com/apis/console) and then creating the Client ID (with package+sha1) again there. After that (5 secs) everything worked on my Android device.
This problem is related to the permissions from the api console.
if you are using a permission related with SCOPE_PLUS_LOGIN, in the api console you must create two keys, one for OAuth client id, and other for public api key.
In my case the problem was that I changed the package name of the app and didn't update in dev console.
For me it was that i was attempting to use my production key when installing it using my debug key. Make sure your using the right SHA1 from the right keystore.
I turned around to the Google IO 2013, and changed the initialization of PlusClient, then it works.
public static final String AUTH_SCOPES[] = {
Scopes.PLUS_LOGIN,
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/developerssite" };
mPlusClient = new PlusClient.Builder(this, this, this)
.setScopes(AUTH_SCOPES)
.build();
Thanks Thano for the solution
"Now this bug as i noticed (at least for me) was that in my cloud console, the project i have created was long ago with the old interface and few months ago i migrated to the new GUI.Once you get the new look on cloud console you will notice that new projects have an auto generated project id like this atlantean-ares-331 while old projects got a long integer value as project id which is not visible. So if your project was created with the old GUI and you have just created new client id for OAuth for that project you will get the Toast "An internal error occurred” while trying to sign in with google."
Recreating the project in the Google Console worked for me after several other attempts:
For any reason my project did not have a project ID (old console/new console?).
As Thano (above) suggested, I created a brand new project, created Client IDs, ... and then in worked. Thanks for the advice!!
Remember to use the built-in debug keystore for testing. I had everything else working correctly, but I had set my production keystore SHA1 fingerprint in the Credentials in the Developers Console, which caused it not to work.
If your facing this error when you try to run the sample application "or" copy the project which you have created in other machine which was running successfully in that and giving such pop-up error in the other machine where you are trying to run ,you can follow the below method and it will help.
If your are building the app for testing/debug purpose then,
1.Generate the new SHA1 if you copy your project and run it on other machine for the package name and path provided for keystore.
2.Change the ClientId in developers console for new generated SHA1 and run it in the new machine where you have copied the project and trying to run it.
Something often overlooked is the package name. I'd like to clarify the step 6 by Eric Leschinski above (can't comment there): the required package is not the package of an activity, rather the package of your app's manifest.
You may retrieve the correct value from the root element of AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.ntk.darkmoor"
android:versionCode="1"
android:versionName="1.0" >
In this example define "com.ntk.darkmoor" while creating the Client ID
I had the same issue when I used SHA1 for debug.keystore for debuging then exported my application forgetting to generate SHA1 for keystore that I used to export my application.
Its working for me when i connect the device and install the apk from Android Studio.
But its now working for me when i generate the .apk and install it from dropbox.
I went through all the answers provided here and others as well. In my case the issue was the SHA-1 as well. The reason I was getting the incorrect SHA-1 was my keytool export cert command.
Previously I was using
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias androiddebugkey -keystore "keystorepath" -list -v
The problem was in the androiddebugkey variable. Here you have to give the name of the key you use for signing the application.
C:\Users\mysuername\.android SHA 1 signature keytool -exportcert -alias mykeyname -keystore "keystorepath" -list -v
Hope this helps someone!
To add to this long list of reasons my problem was that i got the debugkey from the jks file rather than the app.
Its always something small.

PhoneGap Facebook plugin connect with Android

I have a problem using the Facebook Connect plugin with PhoneGap.
I have added this line to file plugins.xml:
<plugin name="com.phonegap.facebook.Connect" value="com.phonegap.facebook.ConnectPlugin" />
And this include on in file FbDialog.java:
import com.phonegap.helloworld.R;
I have these files on src:
com
/facebook/android/
AsyncFacebookRunner.java
DialogError.java
Facebook.java
FacebookError.java
FbDialog.java
Util.java
/phonegap/
facebook/ConnectPlugin.java
helloworld/HelloPhoneGapActivity.java
The ressources files close and the icon is copied. In HTML, I include some JavaScript code:
cordova-1.6.1.js
cdv-plugin-fb-connect.js
facebook_js_sdk.js
I use the default HTML example with my appId.
When I run application on my Android phone, a dialog says:
Cordova Facebook connect plugin fail on init!
and
Cordova Facebook connect plugin fail on auth.status!
If I click the login bouton, the dialog says:
Cordova Facebook connect plugin fail on login!Class not found
And the Eclipse console log is:
I tried to install this with the officiel Git readme and the
tutorial Add Facebook login to PhoneGap/Cordova Android app Easiest way.
When I compile the application, I don't get the error.
How do I fix this problem?
After the switch to Cordova, everything got renamed. You need the new class location:
<plugin name="org.apache.cordova.facebook.Connect" value="org.apache.cordova.facebook.ConnectPlugin" />
You'll have to put your plugin java (back?) to the correct location as well in org/apache/cordova/facebook/ .
Unfortunately, the error for this is pretty vague, but you can see it if you know what to look for. You can see in your logs the line with Message=Class not found in it. It would be better if this line had the name of the class. This error happens when you call the JS for a plugin, but then the right class name can't be found in the plugins.xml file. This is also why you notice that any call fails the same way.
Verify that android studio isn't giving an error like:
A valid Facebook app id must be set in the AndroidManifest.xml or set by calling FacebookSdk.setApplicationId before initializing the sdk.
If so, then edit androidmanifest. See: A valid Facebook app id must be set in the AndroidManifest.xml

Categories

Resources