2017-08-13 118 views
0

我嘗試在我的項目上添加一個Facebook登錄按鈕,但是當我測試錯誤日誌時,請向我顯示: 致命異常:主登錄嘗試失敗:FacebookActivity無法啓動。請確保您已將FacebookActivity添加到AndroidManifest。 但我已經把FacebookActivity的清單如下圖所示:Android上的Facebook登錄按鈕

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.gdp.eparking" > 


<uses-permission android:name="android.permission.INTERNET" /> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> 
    <activity 
     android:name=".ActivityNuevoUsuario" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 
<activity android:name=".ActivityLogueo" 
    android:label="@string/app_name" 
    android:screenOrientation="portrait"> 
</activity> 
<activity android:name=".ActivityPrincipal" 
    android:label="@string/app_name" 
    android:screenOrientation="portrait"> 
</activity> 
<activity android:name="com.facebook.FacebookActivity" 
    android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
    android:theme="@android:style/Theme.Translucent.NoTitleBar" 
    android:label="@string/app_name" /> 

我需要別人的許可?

+0

你有沒有加入你的應用程序ID在strings.xml? –

回答

1

你把應用程序標記以外的活動,更正後的清單應該是:

<?xml version="1.0" encoding="utf-8"?> 
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.gdp.eparking" > 


<uses-permission android:name="android.permission.INTERNET" /> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 
    <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/> 

    <activity 
     android:name=".ActivityNuevoUsuario" 
     android:label="@string/app_name" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
    <activity android:name=".ActivityLogueo" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait"> 
    </activity> 
    <activity android:name=".ActivityPrincipal" 
     android:label="@string/app_name" 
     android:screenOrientation="portrait"> 
    </activity> 
    <activity 
     android:name="com.facebook.FacebookActivity" 
     android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation" 
     android:theme="@android:style/Theme.Translucent.NoTitleBar" 
     android:label="@string/app_name" /> 
</application>