0

I was using TabLayout, but after copying it in my src, I am getting following errors:

(1) android.support.v7.internal.widget.CompatTextView can not be resolved

(2) styleable cannot be resolved or is not a field Though I checked other answers in stackoverflow, but failed to get proper solution. I already imported android.R

(3) I checked that in my android-support-v7-appcompat.jar the class CompatTextView is missing. How this can be possible.

(4) Will there be any legal issue if I copy the TabLayout class given by google for my app? Please help.

  • Update: I added import android.support.v7.appcompat.R; instead of android.R and getting following several error like Widget_Design_TabLayout cannot be resolved or is not a field TabLayout_tabIndicatorHeight cannot be resolved or is not a field TabLayout_tabIndicatorColor cannot be resolved or is not a field etc. Please suggest.
Jaiprakash Soni
  • 4,100
  • 5
  • 36
  • 67
Abhijit
  • 360
  • 4
  • 14
  • 1
    why are you copying that in your src when you can access it using library? Because this class is dependent on other required things! – Paresh Mayani Aug 06 '15 at 04:41
  • ok, but what is the library ? I want to import it all. – Abhijit Aug 06 '15 at 04:52
  • 1
    TabLayout is part of design support library, you just need to include it your build.gradle file to access its classes and resources! – Paresh Mayani Aug 06 '15 at 05:09
  • I have Android Support Library 22.2.1 is Installed in SDK Manager. No where I can find TabLayout class or design library folder. Am I missing something, can you please guide. Thanks for help. – Abhijit Aug 06 '15 at 05:18
  • sorry Paresh, I got it now... it is C:\Program Files (x86)\Android\android-sdk\extras\android\support\design. I imported. Many many thanks for quick response and help... – Abhijit Aug 06 '15 at 05:27

1 Answers1

3

Converting comments into the answer as you have found them helpful and able to resolve your issue.

I don't know why are you importing/copying it manually in your project, because TabLayout is part of design support library, you just need to include its artifact ID in your build.gradle file to access its classes and resources!

compile 'com.android.support:design:+' //replace + with latest version
Paresh Mayani
  • 127,700
  • 71
  • 241
  • 295
  • 1
    Thanks, I progressed a lot from yesterday on Tab implementation correctly. :) – Abhijit Aug 06 '15 at 21:29
  • Just to give you more reference, I am writing a [tutorial series on "Design support library"](http://www.technotalkative.com/lets-explore-android-design-support-library/) on my blog, do check it out if interested. – Paresh Mayani Aug 07 '15 at 05:06
  • @PareshMayani Can u pls help me here? http://stackoverflow.com/questions/35456147/tablayout-cannot-be-resolved-to-a-type-eclipse – Jas Feb 17 '16 at 12:05