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

AscySoft

Active Member
Licensed User
EDIT: Jump to the conclusion and partial fix here

I open this thread to ask if someone else has encountered this issue.
Setup everything as in https://www.b4x.com/android/forum/t...nal-material-design-components.58893/#content
Try download FixedTabsExample2_00.zip file, and set everything up for AHViewPager library.
Update any SDK and try to build example above with "FixedTabIcon" from @corwin42 who's work btw is tremendous.
The error is below
** Activity (main) Pause, UserClosed = true **
** Activity (main) Create, isFirst = false **
main_activity_create (java line: 348)
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:170)
at anywheresoftware.b4a.objects.ActivityWrapper.LoadLayout(ActivityWrapper.java:209)
at example.tablayout.fixedtabsicon.main._activity_create(main.java:348)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at example.tablayout.fixedtabsicon.main.afterFirstLayout(main.java:104)
at example.tablayout.fixedtabsicon.main.access$000(main.java:17)
at example.tablayout.fixedtabsicon.main$WaitForLayout.run(main.java:82)
at android.os.Handler.handleCallback(Handler.java:789)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6944)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.objects.CustomViewWrapper.AfterDesignerScript(CustomViewWrapper.java:64)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:162)
... 14 more
Caused by: java.lang.NoSuchMethodError: No virtual method addOnTabSelectedListener(Landroid/support/design/widget/TabLayout$OnTabSelectedListener;)V in class Landroid/support/design/widget/TabLayout; or its super classes (declaration of 'android.support.design.widget.TabLayout' appears in /data/app/example.tablayout.fixedtabsicon-e7CwkjBxWIm3lh3PiI3hrg==/base.apk)
at de.amberhome.objects.TabLayoutWrapper.innerInitialize(TabLayoutWrapper.java:63)
at anywheresoftware.b4a.objects.ViewWrapper.Initialize(ViewWrapper.java:67)
at de.amberhome.objects.TabLayoutWrapper.Initialize(TabLayoutWrapper.java:52)
at de.amberhome.objects.TabLayoutWrapper._initialize(TabLayoutWrapper.java:90)
... 17 more
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
** Receiver (semails) OnReceive **
Cannot start from a receiver in debug mode.
I know my system is wrongly setup, but I don't know what to do, I tryed so many things (in reality I have a huge app who use some layouts file with AHViewPager views that throw this similar error when loaded, but previously it worked just fine until some sdk? update)
 
Last edited:

npsonic

Active Member
Licensed User
Use B4A Sdk Manager and update all recommended items. Some of your resources are outdated.
 
Upvote 0

AscySoft

Active Member
Licensed User
I've got EVERYTHING up to date so far, sdk 28, all resources also. There are no reccomended item in B4A SDK Manager that are not installed already. The app is perfectly generated but throwing that nasty errors when layouts are loaded (see logs).
I erased everything , java, sdk folder (c:\Android\) I reinstalled java 8, sdk tools from google, set B4A SDK Manager, reinstall everything recommended, + some other resources, but in vain.
I am shure I forgat to update something, but is nothing hightlited in B4A SDK Manager that needs to be updated. Probably I need to update manually some resouces, but I don't have any clue witch one.
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
At least any clue?
Not really a clue. More an idea. I remember the AppCompat Author told something in the past that google has changed (or is changing) AppCompat dependencies.
Maybe it is needed to get an updated AppCompat library (or Designlibrary)? Just a guess.
 
Upvote 0

npsonic

Active Member
Licensed User
Not really a clue. More an idea. I remember the AppCompat Author told something in the past that google has changed (or is changing) AppCompat dependencies.
Maybe it is needed to get an updated AppCompat library (or Designlibrary)? Just a guess.
I just downloaded and tested the example. It works great, nothing to be done just compile and debug.

There must be something that is missing from needed resources or there might be something that is recently changed in libs and resources that you are using.

I have AHViewPager 3.00, AppCompat 3.52, Core 8.50, DesignSupport 2.32, XmlLayoutBuilder 1.00
 
Upvote 0

npsonic

Active Member
Licensed User
I was just reading your stack trace ones again and just a thought, but have you actually tried to delete old app from your device before installing modified app.

There might be nothing wrong with your code or in your resources.
 
Upvote 0

jimmyF

Active Member
Licensed User
What have you listed under #AdditionalJar:?
 
Upvote 0

AscySoft

Active Member
Licensed User
I have AHViewPager 3.00, AppCompat 3.52, Core 8.50, DesignSupport 2.32, XmlLayoutBuilder 1.00
I also have all the above libraries except core 8.30 :) not yet updated.
have you actually tried to delete old app from your device before installing modified app
Well, my app was modified long time ago, is well working on many devices so far, but until recently (few days ago) I realize that some layouts particulary containing AHViewPager throw errors (I constantly improve my app as many devs do, so this release is not yet published). I did try my "new" app on two devices that I own (Android 8, 5.1) and the error is the same. That's why in the first post I mentioned another example that in my case is not working either.
What have you listed under #AdditionalJar:?
This is not relevant any more as I rememberd, but the error is present even in @Erel 's example that I mentioned in first post.

UPDATE: I did try to open the layouts files with designer and send them to UI cloud to be generated. They seemed fine to me, so again the problem is only mine; I am thinking of reinstall the OS and start from scratch. Any other sugestions?
 
Upvote 0

jimmyF

Active Member
Licensed User
his is not relevant any more as I rememberd, but the error is present even in @Erel 's example that I mentioned in first post.

It could be very relevant.
edit:
It is in Erel's example because the jar file in the example has not been updated.
 
Last edited:
Upvote 0

AscySoft

Active Member
Licensed User
jar file in the example
I'm sorry but I don't se a jar file in erel's example, only the below code. Do you see one?
B4X:
#AdditionalRes: ..\resource

#Extends: android.support.v7.app.AppCompatActivity
My real app use one activity without any #AdditionalJar and a few with AppCompat #Extends but no AdditionalJar, and in all scenario when I try loading layouts it fails!

Just to be clear, i think the folowing text file will be self explanatory
The file is located in "C:\Android\extras\b4a_remote\installed-components.txt"
Is this file listing all sdk? and all resources already installed? See for youreself, I don't know fore sure
#Wed Sep 26 23:48:14 EEST 2018
com.google.android.gms\Play-services-plus=15.0.1
com.google.android.gms\play-services-ads=15.0.1
com.android.support\print=28.0.0
com.android.support\:drawerlayout=28.0.0
com.google.android.gms\play-services-ads-license=12.0.1
com.google.firebase\:firebase-iid-interop=16.0.0
com.android.support\:instantvideo=26.0.0-alpha1
com.google.android.gms\play-services-gcm=15.0.1
com.android.support\preference-v14=28.0.0
com.android.support\:versionedparcelable=28.0.0
com.google.firebase\:firebase-firestore=17.1.0
com.android.support\:support-dynamic-animation=28.0.0
com.android.tools\:sdk-common=26.2.0
com.google.android.gms\play-services-appinvite=16.0.3
com.android.tools\:r8=1.2.48
com.google.android.gms\play-services-plus-license=12.0.1
com.google.firebase\:firebase-crash-license=12.0.1
com.android.support\:support-core-utils=28.0.0
com.google.android.gms\play-services-games=15.0.1
com.google.android.gms\play-services-instantapps=16.0.0
com.google.android.gms\play-services-cast-framework=16.0.2
com.google.firebase\:firebase-measurement-connector-impl=17.0.1
com.google.android.gms\play-services-vision-license=12.0.1
com.google.android.gms\play-services-auth-license=11.4.2
com.google.android.gms\play-services-panorama=15.0.1
com.android.support\:interpolator=28.0.0
android.arch.lifecycle\:reactivestreams=1.1.1
com.android.support\:design=28.0.0
com.android.support\:cursoradapter=28.0.0
com.google.firebase\:firebase-storage-common=16.0.1
com.google.android.gms\play-services-wallet=16.0.0
com.android.tools\:testutils=26.2.0
com.android.support\:asynclayoutinflater=28.0.0
com.google.android.gms\play-services-cast-license=12.0.1
com.google.android.gms\play-services-tagmanager-api=16.0.3
com.google.android.gms\play-services-fitness=16.0.0
com.android.support\:loader=28.0.0
com.google.android.gms\play-services-vision-common-license=12.0.1
com.google.firebase\:firebase-auth=16.0.3
com.google.firebase\:firebase-iid-license=12.0.1
com.google.firebase\:firebase-measurement-connector=17.0.0
com.google.gms\:eek:ss-licenses=0.9.2
android.arch.core\:runtime=1.1.1
com.android.support\:recommendation=28.0.0
com.google.firebase\:firebase-auth-impl=11.0.0
com.android.support\:leanback-v17=28.0.0
com.google.android.gms\play-services-safetynet=15.0.1
com.google.firebase\:firebase-storage-common-license=12.0.1
android.arch.lifecycle\:extensions=1.1.1
com.google.android.gms\play-services-auth=16.0.0
com.google.firebase\:firebase-storage-license=12.0.1
com.google.android.gms\:play-services-analytics-impl=16.0.3
com.android.support\:support-emoji-bundled=28.0.0
com.google.android.gms\:play-services-iid-license=12.0.1
com.google.android.gms\:play-services-nearby-license=12.0.1
com.google.firebase\:firebase-analytics-impl-license=12.0.1
com.google.android.gms\:play-services-tagmanager-license=12.0.1
com.google.android.gms\:play-services-tagmanager-v4-impl=16.0.3
com.google.android.gms\:play-services-places-placereport=15.0.1
com.google.firebase\:firebase-database-connection-license=12.0.1
com.google.android.gms\:play-services-drive=15.0.1
com.google.android.gms\:play-services-auth-base-license=12.0.1
com.android.tools.analytics-library\:shared=26.2.0
com.google.android.gms\:play-services-maps=15.0.1
com.android.support\:gridlayout-v7=28.0.0
com.android.support\:support-v13=28.0.0
com.android.installreferrer\:installreferrer=1.0
com.google.android.gms\:play-services-auth-base=15.1.0
com.android.support\:support-content=27.1.1
com.google.firebase\:firebase-ads=15.0.1
com.android.support\:support-compat=28.0.0
com.android.support\:support-emoji=28.0.0
com.google.firebase\:firebase-messaging=17.3.2
com.google.firebase\:firebase-database-license=12.0.1
com.google.firebase\:firebase-common-license=12.0.1
com.android.support\:recyclerview-v7=28.0.0
com.google.android.gms\:play-services-basement-license=12.0.1
com.google.firebase\:firebase-config-license=12.0.1
com.google.android.gms\:auth-api-impl=11.6.0
com.android.support\:appcompat-v7=28.0.0
com.google.android.gms\:play-services-identity-license=12.0.1
android.arch.lifecycle\:runtime=1.1.1
com.android.tools\:repository=26.2.0
android.arch.core\:core-testing=1.1.1
com.google.android.gms\:play-services-analytics=16.0.3
com.google.firebase\:firebase-auth-interop=16.0.0
com.google.android.gms\:play-services-oss-licenses-license=12.0.1
io.fabric.sdk.android\:fabric=1.4.4
android.arch.lifecycle\:common=1.1.1
com.google.android.gms\:play-services-cast-framework-license=12.0.1
com.android.support\:swiperefreshlayout=28.0.0
com.google.android.gms\:play-services-gcm-license=12.0.1
com.google.android.gms\:play-services-appindexing=9.8.0
com.google.firebase\:testlab-instr-lib=0.1
com.google.firebase\:firebase-database=16.0.2
com.google.firebase\:firebase-appindexing-license=12.0.1
com.google.android.gms\:play-services-gass-license=12.0.1
com.google.android.gms\:play-services-places-license=12.0.1
com.google.firebase\:firebase-appindexing=16.0.1
com.google.android.gms\:play-services-auth-api-phone-license=12.0.1
com.google.android.gms\:play-services-places=15.0.1
android.arch.core\:common=1.1.1
com.google.android.gms\:play-services-all-wear=15.0.1
com.google.android.gms\:play-services-instantapps-license=12.0.1
com.google.firebase\:firebase-database-connection=16.0.1
com.google.android.gms\:play-services-location-license=12.0.1
com.google.android.gms\:play-services-tagmanager=16.0.3
com.android.support\:customtabs=28.0.0
android.arch.lifecycle\:livedata-core=1.1.1
com.android.support\:support-emoji-appcompat=28.0.0
com.google.firebase\:firebase-perf-license=12.0.1
com.google.android.gms\:play-services-ads-base=15.0.1
com.android.support\:coordinatorlayout=28.0.0
com.android.support\:support-media-compat=28.0.0
com.google.android.gms\:play-services-nearby=15.0.1
com.google.android.gms\:play-services-ads-lite=15.0.1
com.android.support\:wear=28.0.0
com.google.android.gms\:play-services-wallet-license=12.0.1
com.google.android.gms\:play-services-ads-lite-license=12.0.1
com.google.android.gms\:play-services-measurement=8.4.0
com.google.android.gms\:play-services-analytics-license=12.0.1
android.arch.core\:core=1.0.0-alpha3
com.google.android.gms\:play-services-appstate=8.4.0
com.google.android.wearable\:wearable=2.3.0
com.google.android.gms\:play-services-fitness-license=12.0.1
com.google.android.gms\:play-services-iid=15.0.1
com.google.firebase\:firebase-common=16.0.2
com.android.support\:palette-v7=28.0.0
android.arch.lifecycle\:livedata=1.1.1
com.google.android.gms\:play-services-drive-license=12.0.1
com.android.support\:multidex-instrumentation=1.0.3
com.google.android.support\:wearable=2.3.0
com.google.android.gms\:play-services-panorama-license=12.0.1
com.android.support\:exifinterface=28.0.0
com.google.android.gms\:play-services-maps-license=12.0.1
com.android.support\:cardview-v7=28.0.0
com.google.android.gms\:play-services-phenotype=15.0.1
com.android.support\:support-tv-provider=28.0.0
com.android.support\:customview=28.0.0
com.android.support\:slidingpanelayout=28.0.0
com.android.tools\:dvlib=26.2.0
com.android.tools\:sdklib=26.2.0
com.google.firebase\:firebase-auth-module=9.8.0
com.crashlytics.sdk.android\:crashlytics-core=2.6.4
com.google.android.gms\:play-services-measurement-api=16.0.1
com.google.firebase\:firebase-auth-license=12.0.1
com.crashlytics.sdk.android\:answers=1.4.3
com.android.support\:animated-vector-drawable=28.0.0
com.crashlytics.sdk.android\:crashlytics=2.9.5
com.google.firebase\:firebase-crash=16.2.0
com.android.support\:design-tabs=28.0.0-alpha1
com.google.android.gms\:play-services-oss-licenses=16.0.0
com.android.support\:viewpager=28.0.0
com.crashlytics.sdk.android\:crashlytics-ndk=2.0.5
com.google.firebase\:firebase-storage=16.0.2
com.google.firebase\:firebase-analytics=16.0.3
com.google.android.gms\:play-services-awareness=15.0.1
com.android.tools\:devicelib=26.2.0
com.google.android.gms\:play-services-identity=15.0.1
com.google.android.gms\:play-services-flags=15.0.1
com.google.android.gms\:play-services-tagmanager-v4-impl-license=12.0.1
com.google.android.gms\:play-services-stats=15.0.1
com.google.android.gms\:play-services-measurement-base=16.0.2
com.google.firebase\:firebase-dynamic-links-license=12.0.1
com.google.android.gms\:play-services-fido=15.0.1
android.arch.lifecycle\:viewmodel=1.1.1
com.google.android.gms\:play-services-safetynet-license=12.0.1
com.google.android.gms\:play-services-base=15.0.1
com.android.support\:wearable=26.0.0-alpha1
com.android.support\:support-vector-drawable=28.0.0
com.google.android.gms\:play-services-appinvite-license=12.0.1
com.google.firebase\:firebase-dynamic-links=16.1.1
com.android.support\:support-annotations=28.0.0
com.android.tools\:common=26.2.0
com.google.firebase\:firebase-auth-common=9.8.0
com.google.firebase\:firebase-perf=16.1.0
com.android.support\:support-fragment=28.0.0
com.google.android.gms\:play-services-gass=15.0.1
com.google.android.gms\:play-services-vision-common=15.0.2
com.google.android.gms\:play-services-analytics-impl-license=12.0.1
com.google.android.gms\:play-services-awareness-license=12.0.1
com.google.android.gms\:play-services-wearable-license=12.0.1
com.google.android.gms\:play-services-contextmanager=9.4.0
com.crashlytics.sdk.android\:beta=1.2.10
com.google.android.gms\:play-services-basement=15.0.1
com.google.firebase\:firebase-config=16.0.0
com.google.android.gms\:play-services-wearable=16.0.0
com.android.support\:percent=28.0.0
com.google.firebase\:firebase-invites=16.0.3
com.google.android.gms\:play-services-tagmanager-api-license=12.0.1
com.android.support\:preference-v7=28.0.0
com.android.support\:multidex=1.0.3
android.arch.lifecycle\:common-java8=1.1.1
com.google.firebase\:firebase-analytics-license=12.0.1
com.google.android.gms\:play-services-fido-license=12.0.1
com.google.firebase\:firebase-core=16.0.3
com.google.android.gms\:play-services-clearcut=15.0.1
com.google.android.gms\:play-services-tasks=15.0.1
com.google.android.gms\:play-services-auth-api-phone=15.0.1
com.google.android.gms\:play-services-ads-identifier=15.0.1
com.android.support\:documentfile=28.0.0
com.android.support\:collections=28.0.0
com.android.tools.analytics-library\:inspector=26.2.0
com.android.tools.analytics-library\:protos=26.2.0
com.google.android.gms\:play-services-vision=15.0.2
com.google.android.gms\:play-services-games-license=12.0.1
com.android.support\:support-v4=28.0.0
com.google.firebase\:firebase-iid=17.0.2
com.google.android.gms\:play-services-location=15.0.1
com.google.android.gms\:play-services-cast=16.0.2
com.android.support\:mediarouter-v7=28.0.0
com.google.android.gms\:play-services-base-license=12.0.1
com.google.android.gms\:play-services=12.0.1
com.android.support\:preference-leanback-v17=28.0.0
com.android.support\:support-core-ui=28.0.0
android.arch.lifecycle\:compiler=1.1.1
com.google.firebase\:firebase-analytics-impl=16.2.1
com.android.support\:transition=28.0.0
com.android.tools.analytics-library\:publisher=26.2.0
com.android.tools\:annotations=26.2.0
com.android.tools.analytics-library\:tracker=26.2.0
com.android.support\:localbroadcastmanager=28.0.0
com.google.firebase\:firebase-messaging-license=12.0.1
com.google.android.gms\:play-services-tasks-license=12.0.1
 
Last edited:
Upvote 0

jimmyF

Active Member
Licensed User
Sorry, I just remember that I had a similar if not the same problem because some of the AppComp #AdditionalJar or #Extends files had been upgraded or replaced with newer ones. I thought it might be the same situation.
 
Upvote 0

jimmyF

Active Member
Licensed User
I have worked on this for a while and I see no solution, with my limited knowledge, to the problem.
But, on a positive note, I have it working quite well using the TabStripViewPager library.

https://www.b4x.com/android/forum/threads/tabstripviewpager-better-viewpager.63975/

Use it and you can get rid of the AHViewPager, AHPageContainer, and DSTabLayout

Incidently, it is the DSTabLayout that is causing all the problems.

hth
-j
 
Upvote 0

AscySoft

Active Member
Licensed User
I was thinking of that, but for me right now is more like "reinventing the wheel"...well sort of.
@jimmyF Are you so kind to list all the files/folders in your "c:\android\" or similar folder to a text file and PM to me or add it in here?
I will compare this file with the one generetad for my system and the I will decide what to do next, maybe I am missing a resource.

To do so please open a command prompt, navigate to your "android sdk folder" (mine is C:\Android\)
then just write this command dir /a-d /b /s >allfiles.txt and after completion please send me the "allfiles.txt" file.
This will only take less than a minute. Thanks in advance.
 
Upvote 0

DonManfred

Expert
Licensed User
Upvote 0

DonManfred

Expert
Licensed User
If so, how come that
i tested the example you posted a link in post #1.

It does NOT work for me too.

I tested also the Viewpager Jimmy suggested and it works fine.

Is this a general api change or just my system gone crazy?
I think it is a general Api change and DSTablayout needs an Update.
 
Upvote 0

jimmyF

Active Member
Licensed User
I was thinking of that, but for me right now is more like "reinventing the wheel"...well sort of.
@jimmyF Are you so kind to list all the files/folders in your "c:\android\" or similar folder to a text file and PM to me or add it in here?
I will compare this file with the one generetad for my system and the I will decide what to do next, maybe I am missing a resource.

To do so please open a command prompt, navigate to your "android sdk folder" (mine is C:\Android\)
then just write this command dir /a-d /b /s >allfiles.txt and after completion please send me the "allfiles.txt" file.
This will only take less than a minute. Thanks in advance.


File is too large even when zipped
 
Upvote 0

AscySoft

Active Member
Licensed User
Mine is "only" 126k when zipped 7z, or 4mb plain. Please send me your file via email. I'll PM to you my email (right now it's giving me an error).
I think it is a general Api change and DSTablayout needs an Update
So every other programmer should shitch from AHViewPager to TabStripViewPager? Or I was the only one who use AH? No one else is having this kind of troubles?
I would like a confirmation from @corwin42 or even @Erel if possible. Thank you all.
 
Upvote 0

jimmyF

Active Member
Licensed User
Mine, zipped, is 569 KB. Unzipped is 9134 KB (8.91 MB)
But the forum software will not permit me upload it.
Says it is too large.
 
Upvote 0
Top