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

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?
But the forum software will not permit me upload it
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.
 

jimmyF

Active Member
Licensed User
My SDK is totally up to date. Maybe that is the issue.

@jimmyF did you update all SDK resources and compile and run succesefully Erel's example FixedTabsExample2_00.zip ?
I downloaded it and compiled it but could not run it on any of my phones. Same error as you.

I was unable to PM you because you limit this functionality
Sorry about that. I didn't realize I had done so. I think I have changed it now.
 

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.
 

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.
 

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.
 

AscySoft

Active Member
Licensed User
I opended a bug in the Android issue tracker
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.
wrong signature
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:

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:

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.
Downgrading to API 27 should be possible by just deleting the 28.0.0 directories under all the support library folders
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.
 

AscySoft

Active Member
Licensed User
Don't forget to change release in <sdk>\extras\b4a_remote\installed-components.txt
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:

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.
 

Roberto P.

Well-Known 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.
View attachment 73023

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