title: Facebook SDK issues with app name mismatch while trying to share via Android app
body: <p>I'm having the hardest time getting the Facebook sdks integrated with my android app.  All I want to do is utilize the sharing feature of the sdk.</p>
  
  <p>I get the following error:</p>
  
  <p>I'm currently have my gradle configured to 
      compile 'com.facebook.android:facebook-android-sdk:3.21.1'</p>
  
  <p>String.xml</p>
  
  <pre><code> &lt;string name="app_name"&gt;TestApp&lt;/string&gt;
   &lt;string name="facebook_app_id"&gt;123456789&lt;/string&gt;
  </code></pre>
  
  <p>With in my AndroidManifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.test" &gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.CHANGE_WIFI_STATE" /&gt;
     &lt;application
          android:allowBackup="true"
          android:icon="@drawable/mtr_icon"
          android:label="@string/app_name"
          android:theme="@style/AppTheme"
          android:name="com.test.Application"
          android:hardwareAccelerated="true"&gt;
  
  
  
      &lt;activity
          android:name="com.test.MainActivity"
          android:label="@string/app_name" &gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  
      &lt;meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/&gt;
      &lt;activity android:name="com.facebook.LoginActivity"
          android:theme="@android:style/Theme.Translucent.NoTitleBar"
          android:label="@string/app_name" /&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>Code for sharing:</p>
  
  <pre><code>  // Publish the post using the Share Dialog
   FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(_activity)
  .setApplicationName("TestApp")
  .build();
  </code></pre>
  
  <p>Within the actual Facebook Dashboard:</p>
  
  <pre><code> - Google Play Package Name = com.test
   - Class Name = com.test.MainActivity
   - Display Name = TestApp
   - App ID = 123456789
   - Also added the keyHashes to the keystore that is used to sign the generated apt
  </code></pre>
  
  <p>Note: The TestApp is stated "This app is in development mode" within the Facebook dashboard.   </p>
  
  <p>When I run the application, I get the error when it tries to share the information and get the exception:</p>
  
  <p><strong><code>Error: com.facebook.FacebookException: Failed to authenticate the application because of app name mismatch.  Please check the application name configured by the dialog.</code></strong> </p>
  
  <ol>
  <li>I can't figure out what i'm doing wrong because the app name
  "TestApp" matches the "Display Name" under the Facebook ->Settings
  -> Display Name "TestApp".  I've verified that the appId is the same as well.</li>
  <li>Does that Facebook app need to be published and is this why i'm having issue?  I only want to use the sdk so that the native android app can post to Facebook. </li>
  <li>Is there anything else i'm just not seeing.</li>
  </ol>
  
  <p>I followed the instructions here: <a href="https://developers.facebook.com/docs/android/getting-started#maven" rel="nofollow">https://developers.facebook.com/docs/android/getting-started#maven</a></p>
  
  <p>Any advice appreciated!
  Thanks,
  Derek</p>