Why the import android.support.v7.widget.Toolbar cannot be resolved in my project

∥☆過路亽.° 提交于 2019-12-13 06:39:08

问题


I've trying create an app which is need Toolbar. I've already add "appcompat_v7.jar" to my project which I've got no result.

I've already review some links below and they couldn't help so.

The Import android.support.v7 cannot be resolved

The import android.support.v7.app cannot be resolved

The Import android.support.v7 cannot be resolved

Here is my "AndroidManifect":

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tabex"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="7"
        android:targetSdkVersion="21" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            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>

</manifest>

Also image from Eclipse:

As you can see other import from v7 works but the Toolbar not. I've really appropriate your help.


回答1:


Looking at your SDK Manager screenshot, you are using an old version of the Support Library. The Toolbar widget did not get introduced until v21, you are using v20. Upgrade to latest.




回答2:


I've Upgrade my Android Support Library to Latest version which is 23.0.1 and It's work hundred percent.



来源:https://stackoverflow.com/questions/33711139/why-the-import-android-support-v7-widget-toolbar-cannot-be-resolved-in-my-projec

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!