无法解决RecyclerView版本24.2.1

时间:2017-01-31 15:13:19

标签: android android-recyclerview build.gradle

我尝试使用RecyclerView版本24.2.1进行编译,但我总是遇到build.gradle错误无法解决:com.android.support:RecyclerView- ... 。 我也试过不同的版本,但总是有同样的失败。

我的build.gradle有以下形式:

android {
  compileSdkVersion 24
  buildToolsVersion "24.0.1"
  .....
dependencies {    
  compile fileTree(dir: 'libs', include: ['*.jar'])
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
  })
  compile 'com.android.support:appcompat-v7:24.2.1'
  compile 'com.android.support:design:24.2.1'
  compile 'com.android.support:cardview-v7:24.2.1'
  compile 'com.android.support:RecyclerView-v7:24.2.1'
  compile 'org.greenrobot:eventbus:3.0.0'
  compile 'org.nanohttpd:nanohttpd:2.2.0'
  testCompile 'junit:junit:4.12'
}

通过我安装的SDK-Manager:

  • Android SDK工具25.2.5
  • Android SDK Platform-tools 25.0.3
  • Android SDK Build-tools 24.0.1
  • API 25
  • API 24
  • Android支持存储库第42版
  • Google Repository Rev 42

我该如何解决这个失败? 提前致谢

2 个答案:

答案 0 :(得分:1)

尝试小写:

compile 'com.android.support:recyclerview-v7:24.2.1'

答案 1 :(得分:-2)

public function user_login_process(){

    $this->form_validation->set_rules('username', 'Username', 'trim|required');
    $this->form_validation->set_rules('password', 'Password', 'trim|required');

    if ($this->form_validation->run() == FALSE) 
    {
        if(isset($this->session->userdata['logged_in']))
        {
            $this->load->view('includes/header');
            $this->load->view('home/home_view');
            $this->load->view('includes/footer');
        }
        else{
            $this->load->view('includes/header');
            $this->load->view('account/login_view');
            $this->load->view('includes/footer');
        }
    } 
    else 
    {
        $data = array(
                        'username' => $this->input->post('username'),
                        'password' => $this->input->post('password')
                                );

        $result_is_staff = $this->login_database->login_staff($data);
        $result_is_knowledge_seeker = $this->login_database->login_know_seeker($data);


        if ($result_is_knowledge_seeker == TRUE) 
        {
            $username = $this->input->post('username');

            $result = $this->login_database->read_knowledgeseeker_information($username);

            if ($result != false) 
            {
                $session_data = array(
                                'username' => $result[0]->username
                                );

                // Add user data in session
                $this->session->set_userdata('logged_in', $session_data);

                $this->load->view('includes/header');
                $this->load->view('home/home_view');
                $this->load->view('includes/footer');
                //$this->load->view('admin_page');
            }
        }
        elseif($result_is_staff == TRUE)
        {
            $username = $this->input->post('username');

            $result = $this->login_database->read_staff_information($username);

            if ($result != false) 
            {
                $session_data = array(
                                'username' => $result[0]->username
                                );

                // Add user data in session
                $this->session->set_userdata('logged_in', $session_data);

                $this->load->view('includes/header');
                $this->load->view('admin/admin_view');
                $this->load->view('includes/footer');
                //$this->load->view('admin_page');
            }
        } 
        else 
        {
            $data =array(
                        'error_message' => 'Invalid Username or Password'
                        );

            //$this->load->view('login_form', $data);

            $this->load->view('includes/header');
            $this->load->view('account/login_view',$data);
            $this->load->view('includes/footer');
        }
    }
}