Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/198.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为android编写Facebook登录应用程序时出错_Android_Eclipse - Fatal编程技术网

为android编写Facebook登录应用程序时出错

为android编写Facebook登录应用程序时出错,android,eclipse,Android,Eclipse,我将facebook SDK与我的android项目集成。这是我得到的错误堆栈: [2015-01-06 18:54:50 - HelloFacebookSample] Unable to resolve target 'android-9' [2015-01-06 18:54:50 - FacebookSDK] Unable to resolve target 'android-9' [2015-01-06 18:54:50 - NativeAdSample] Unable to resolv

我将facebook SDK与我的android项目集成。这是我得到的错误堆栈:

[2015-01-06 18:54:50 - HelloFacebookSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - FacebookSDK] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - NativeAdSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - PlacePickerSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - Scrumptious] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - RPSSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - AdUnitsSample] Unable to resolve target 'android-11'
[2015-01-06 18:54:50 - FriendPickerSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - SwitchUserSample] Unable to resolve target 'android-9'
[2015-01-06 18:54:50 - Fblog] Found 3 versions of android-support-v4.jar in the dependency list,
[2015-01-06 18:54:50 - Fblog] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-01-06 18:54:50 - Fblog] All versions of the libraries must be the same at this time.
[2015-01-06 18:54:50 - Fblog] Versions found are:
[2015-01-06 18:54:50 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\appcompat_v7\libs\android-support-v4.jar
[2015-01-06 18:54:50 - Fblog]   Length: 995624
[2015-01-06 18:54:50 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:54:50 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\Fblog\libs\android-support-v4.jar
[2015-01-06 18:54:50 - Fblog]   Length: 995624
[2015-01-06 18:54:50 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:54:50 - Fblog] Path: C:\Users\AjayKumar\Desktop\facebook-android-sdk-3.21.1\facebook-android-sdk-3.21.1\facebook\libs\android-support-v4.jar
[2015-01-06 18:54:50 - Fblog]   Length: 758727
[2015-01-06 18:54:50 - Fblog]   SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
[2015-01-06 18:54:50 - Fblog] Jar mismatch! Fix your dependencies
[2015-01-06 18:54:51 - Fblog] Found 3 versions of android-support-v4.jar in the dependency list,
[2015-01-06 18:54:51 - Fblog] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-01-06 18:54:51 - Fblog] All versions of the libraries must be the same at this time.
[2015-01-06 18:54:51 - Fblog] Versions found are:
[2015-01-06 18:54:51 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\appcompat_v7\libs\android-support-v4.jar
[2015-01-06 18:54:51 - Fblog]   Length: 995624
[2015-01-06 18:54:51 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:54:51 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\Fblog\libs\android-support-v4.jar
[2015-01-06 18:54:51 - Fblog]   Length: 995624
[2015-01-06 18:54:51 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:54:51 - Fblog] Path: C:\Users\AjayKumar\Desktop\facebook-android-sdk-3.21.1\facebook-android-sdk-3.21.1\facebook\libs\android-support-v4.jar
[2015-01-06 18:54:51 - Fblog]   Length: 758727
[2015-01-06 18:54:51 - Fblog]   SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
[2015-01-06 18:54:51 - Fblog] Jar mismatch! Fix your dependencies
[2015-01-06 18:55:11 - Fblog] Found 3 versions of android-support-v4.jar in the dependency list,
[2015-01-06 18:55:11 - Fblog] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-01-06 18:55:11 - Fblog] All versions of the libraries must be the same at this time.
[2015-01-06 18:55:11 - Fblog] Versions found are:
[2015-01-06 18:55:11 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\appcompat_v7\libs\android-support-v4.jar
[2015-01-06 18:55:11 - Fblog]   Length: 995624
[2015-01-06 18:55:11 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:55:11 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\Fblog\libs\android-support-v4.jar
[2015-01-06 18:55:11 - Fblog]   Length: 995624
[2015-01-06 18:55:11 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:55:11 - Fblog] Path: C:\Users\AjayKumar\Desktop\facebook-android-sdk-3.21.1\facebook-android-sdk-3.21.1\facebook\libs\android-support-v4.jar
[2015-01-06 18:55:11 - Fblog]   Length: 758727
[2015-01-06 18:55:11 - Fblog]   SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
[2015-01-06 18:55:11 - Fblog] Jar mismatch! Fix your dependencies
[2015-01-06 18:55:37 - Fblog] Found 3 versions of android-support-v4.jar in the dependency list,
[2015-01-06 18:55:37 - Fblog] but not all the versions are identical (check is based on SHA-1 only at this time).
[2015-01-06 18:55:37 - Fblog] All versions of the libraries must be the same at this time.
[2015-01-06 18:55:37 - Fblog] Versions found are:
[2015-01-06 18:55:37 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\appcompat_v7\libs\android-support-v4.jar
[2015-01-06 18:55:37 - Fblog]   Length: 995624
[2015-01-06 18:55:37 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:55:37 - Fblog] Path: C:\Users\AjayKumar\androidworkspace\Fblog\libs\android-support-v4.jar
[2015-01-06 18:55:37 - Fblog]   Length: 995624
[2015-01-06 18:55:37 - Fblog]   SHA-1: 3e4e879d0b3dc11f2feb3f55e77e3b5bd82c4a28
[2015-01-06 18:55:37 - Fblog] Path: C:\Users\AjayKumar\Desktop\facebook-android-sdk-3.21.1\facebook-android-sdk-3.21.1\facebook\libs\android-support-v4.jar
[2015-01-06 18:55:37 - Fblog]   Length: 758727
[2015-01-06 18:55:37 - Fblog]   SHA-1: efec67655f6db90757faa37201efcee2a9ec3507
[2015-01-06 18:55:37 - Fblog] Jar mismatch! Fix your dependencies
我是android开发的初学者。我安装了eclipse和ADT工具。我正在尝试为android编写一个android应用程序。下面是我的java代码:

package com.cheerz.fblog;

import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.ActionBar;
import android.support.v4.app.Fragment;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.os.Build;

public class MainActivity extends ActionBarActivity {

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        if (savedInstanceState == null) {
            getSupportFragmentManager().beginTransaction()
                    .add(R.id.container, new PlaceholderFragment()).commit();
        }
    }

    /* activates the log for the app */
    @Override
    protected void onResume() {
        super.onResume();

        // Logs 'install' and 'app activate' App Events.
        AppEventsLogger.activateApp(this);
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_settings) {
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    /**
     * A placeholder fragment containing a simple view.
     */
    public static class PlaceholderFragment extends Fragment {

        public PlaceholderFragment() {
        }

        @Override
        public View onCreateView(LayoutInflater inflater, ViewGroup container,
                Bundle savedInstanceState) {
            View rootView = inflater.inflate(R.layout.fragment_main, container,
                    false);
            return rootView;
        }

        @Override
        protected void onPause() {
            super.onPause();

            // Logs 'app deactivate' App Event.
            AppEventsLogger.deactivateApp(this);
        }
    }
}

您可能已经设置了MinSDK版本9,但未在sdk管理器中安装软件包api 2.3。

将清单文件目标版本写入sdk中的最大版本