Android appcompat v7 error

后端 未结 9 575
盖世英雄少女心
盖世英雄少女心 2020-12-10 12:21

Being new to Android developent I followed the simplest of tutorials, built a new android project, accepting all default settings (built it for kitkat). To my dismay I have

相关标签:
9条回答
  • 2020-12-10 12:45

    Need to update your SDK manager

    click ur sdk manager icon in the ecilipse then update android support Repository in the extras

    then

    go to File->import->existing project

    abt bundle->sdk->extra->android->support->v7 to workspace

    after import v7 to workspace go to lib folder choose both jar and right click and choose build to workspace then again right click v7 project go to java build path choose the checkbox and click apply and ok..

    if u have updated sdk then follow this steps

    step 1:

    Right click ur project then go to

    property->choose java build path

    step 2:

    click Add External jar

    Step 3:

    Browse to ur adt bundle go to ur workspace choose the folder

    android-support-v7-appcompat -> lib -> appcompat_v7.jar

    0 讨论(0)
  • 2020-12-10 12:49

    The appcompat_v7 library is added by default to an Android project. You will most likely need it for any demo projects you start making.

    To correctly add this library, follow these steps:

    For Android Studio:

    1. Ensure that you have the Android Support Repository installed in your SDK Manager:

    2. In your build.gradle file, include the following implementation statement

    implementation 'com.android.support:appcompat-v7:+'
    

    within the dependency bracket.

    3. Perform a Gradle sync with the Sync Project button.


    ~LEGACY ANSWER~:

    For Eclipse:

    The trick is, you need to clean & build the appcompat_v7 project. Go to

    Project -> select Clean -> select the project. 
    

    After doing this, if the project does not get built automatically, right click on the project in the package explorer and select Build Project. Now the .jar file will be generated in the project's bin folder. After that, clean & build all projects that reference appcompat_v7.

    Now the library should be correctly referenced by all projects that need it.

    Note also that:

    • You must have the latest versions of SDK Tools / Build Tools / Platform Tools. If you try this and it doesn't work, then go to the Android SDK Manager and make sure you have the latest versions of the required tools.
    • In case your project only requires API level 14 (Ice Cream Sandwich) & above, select API level 14 for "minimum required SDK" in the project wizard when you create a new project. Now the appcompat_v7 library will not be required for this project, and the application will use the native ActionBar class which is present in AOSP builds from ICS onwards.

    Further References:

    1. How to add Android Support v7 libraries in eclipse.

    2. Android actionbar how to add supporting library v7 appcompat for Eclipse.

    3. android-support-v7-appcompat library project won't work.

    4. Difference between android-support-v7-appcompat and android-support-v4.

    0 讨论(0)
  • 2020-12-10 12:50

    it worked for me when i changed project build tarjet to API 21 for the android_support_v7_appcompact project

    0 讨论(0)
  • 2020-12-10 12:53

    I had the same problem and I tried all of mentionded above advices and much more from, but no one helped me to solve my issue. My solution was creating a progect with minimum required SDK API 14: Android 4.0 (IceCreamSandwich). Doing this way Eclipse will not create appcompat_v7 project.

    Also I found another, better, solution:

    1. Go to Android SDK Manager and install Android 5.0.1 (API 21) or newer. If you don't use the emulator you can install only SDK Platform and Google APIs;
    2. Go to appcompat_v7 -> Properties -> Android and check Android 5.0.1 in the Project Build Target;
    3. Then go to Java Build Path -> Order and Export and check Android 5.0.1;
    4. Do the same procedure for your project.
    0 讨论(0)
  • 2020-12-10 12:55

    Appcompat_7 error solved!

    Hi, im a complete beginner, i solved my problem by go to SDK manager update/install all the new android sdk build tools (as im not sure which is which i should update/install so i update/install all the build tools. after updated/installed all the new build tools i closed my eclipse and relaunch the eclipse again. if you see any error again? go to the top bar click PROJECT and choose CLEAN. and run your application again and i think it will work fine..

    0 讨论(0)
  • 2020-12-10 12:57

    I was having with same Issue and fed up but finally I got the answer . I resolved this by Copy appcompat library E:\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat and paste appcompat Library in the the Project which I want to Import . I close the Eclipse and reopen. But One thing I want to consider before these stuff I updated Android Support Repository and Android Support Library as well.

    0 讨论(0)
提交回复
热议问题