Android Question AH View Pager layout throwing errors on com.android.support.design 28.0.0

Discussion in 'Android Questions' started by AscySoft, Sep 26, 2018.

Tags:
  1. DonManfred

    DonManfred Expert Licensed User

    the limit to upload is 500 kb or so
     
    jimmyF likes this.
  2. AscySoft

    AscySoft Active Member Licensed User

    @jimmyF did you update all SDK resources and compile and run succesefully Erel's example FixedTabsExample2_00.zip ?
    I belive that @DonManfred 's right that it's an API change from google, so I'm wonderring how could you successfully compile and run apk on a updated sdk machine/device?
    I was unable to PM you because you limit this functionality. If you want PM me your email so I can contact you, I just need to give you my email, or you culd use an online free upload service and PM the link to me.
     
  3. AscySoft

    AscySoft Active Member Licensed User

    Did you update all the sdk and all the resources via B4A SDK Manager and then compile and run again this example? In my and Don's cases it will fail. How abaout you?
     
  4. jimmyF

    jimmyF Active Member Licensed User

    My SDK is totally up to date. Maybe that is the issue.

    I downloaded it and compiled it but could not run it on any of my phones. Same error as you.

    Sorry about that. I didn't realize I had done so. I think I have changed it now.
     
  5. AscySoft

    AscySoft Active Member Licensed User

    So in lack of any reply from @corwin42 I don't think that AHViewPager will get any compatibility update (Design support library), then is time to use Erel's ViewPager. Here I go reinventing the whell again!
    Thank you all for your replies!
     
    Last edited: Sep 28, 2018
  6. corwin42

    corwin42 Expert Licensed User

    I can confirm the problem.

    After upgrading to support library 28.0.0 the error occurs while starting the app.

    I just start to understand, where the problem is.

    It has something to do with the fact that support library is moving to androidx.xxx packages. I guess Google has done something bad with the tablayout. Maybe it can be fixed with a new dependency but I'm still searching for the solution.
     
  7. DonManfred

    DonManfred Expert Licensed User

    Maybe Google has not finished rebuilding the dependencies.
    I saw a lot of changes (new Components) due to sdk 28 in the SDK Manager last week.
     
  8. AscySoft

    AscySoft Active Member Licensed User

    Last edited: Oct 1, 2018
  9. corwin42

    corwin42 Expert Licensed User

    Downgrading to API 27 should be possible by just deleting the 28.0.0 directories under all the support library folders.

    I opended a bug in the Android issue tracker: https://issuetracker.google.com/issues/116821445

    Unfortunately I was not able to reproduce this problem with Android Studio (I created a simple AS project which just calls addOnTabSelectedListener()). Therefore I guess the problem only happens when the project is built with aapt.

    @Erel: Do you know, if the stuff downloded by your SDK Manager is different from that that Android Studio will download? I think they both use the same Maven repository. So don't really have an idea where the problem exactly is. Maybe there is something wrong with dependency handling.
     
  10. corwin42

    corwin42 Expert Licensed User

    I just inspected the contents of the generated opt.jar under Objects\bin\extra and the addOnSelectedListener() method is in there.
    So I guess there is really a problem with the build process. The two possibilities are: the method gets removed somewhere or it can not be found because of a wrong signature or something.
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    If you like send me the source code and I'll try to compile it here and test it.
     
    Pencil3, AscySoft and DonManfred like this.
  12. AscySoft

    AscySoft Active Member Licensed User

    I assumed it was you, you beat me by minutes. Intresting that they mention that <<
    Application built with aapt -> java.lang.NoSuchMethodError: No virtual method addOnTabSelectedListener
    - Application built with Gradle -> no problem>>
    I also will wait for @Erel's answere.
    If it was a wrong signature i think the error will not be raise as NoSuchMethod but more likeley WrongSignature.... But I am just guessing.
     
    Last edited: Oct 8, 2018
  13. Semen Matusovskiy

    Semen Matusovskiy Well-Known Member Licensed User

    Android Studio, I think, uses aapt2.exe unlike B4A, which uses aapt.exe.
    Probably, replacing deprecated aapt.exe to aapt2.exe will fix a problem.

    I would made expriments, but both tools have a lot of parameters (which are not the same).
    So, such trick like renaming aapt2.exe to aapt.exe will not work.
     
    Last edited: Oct 4, 2018
  14. AscySoft

    AscySoft Active Member Licensed User

    Someone replyed at google issue tracker link saying that "TabLayout 28.0.0 is not binary compatible with previous versions due to this signature change with addOnTabSelectedListener()"
    As I don't know how to check for this I cannot confirm, but if this is so then the problem will be a patch from google.
    Is not so simple, I don't have any old "27" support lib because B4A Sdk Manager will delete all the old ones when it makes an update.
     
  15. Semen Matusovskiy

    Semen Matusovskiy Well-Known Member Licensed User

    Guess you need attached file (extract it in <SDK>\extras\b4a_remote\com\android\support\design subdirectory.
    Don't forget to change release in <sdk>\extras\b4a_remote\installed-components.txt
     

    Attached Files:

    AscySoft likes this.
  16. AscySoft

    AscySoft Active Member Licensed User

    That did the trick. In 'installed-components' change this line "com.android.support\:design=28.0.0" to 27.1.1
    Thanks for the files also. They were missing from my design resources. Now I compile under sdk 28 and support design 27 and everything works again!
    PS. I'm waiting for google's fix for this. For everyone who don't read this thread keep this in minde only this: In API 28 design support library seems to have a bug (wrong signature). DO NOT UPDATE to com.android.support.design 28 if your cod is using AHViewPager ie (nothing's wrong with AH).
     
    Last edited: Oct 22, 2018
  17. jimmyF

    jimmyF Active Member Licensed User

    I don't understand this becuase I am compiling under Android-28, using AHViewPager, in a large project and I have had no issues with it. Once the SDK was properly installed, that is.
    I really think the issue is with DSTabLayout. When I tested the BaA Material Design samples before, that is where the problem was.
     
  18. AscySoft

    AscySoft Active Member Licensed User

    Just as I said. Support.design (28) and API SDK (28) are two complete different things (that could, should work togheter if needed).
    I am keeping (support design) to 27 version, even if manager reccomends to install 28. I compile under 28 platform also. So far so good.
    sdkm.png
     
    Last edited: Oct 8, 2018
  19. Roberto P.

    Roberto P. Well-Known Member Licensed User


    ok, I proceeded to restore the 27 with B4A 8.50, hoping that everything will be resolved soon.
    thank you
     
  20. corwin42

    corwin42 Expert Licensed User

    AscySoft, jimmyF, Erel and 1 other person like this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice