I have been reading
I am working on a b4i/b4a app.
I noticed when i design the layout in b4i and then copy the views to b4a i get this error.
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
#SupportedOrientations attribute must be set to landscape or portrait.
*** mainpage: B4XPage_Created
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:38)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:338)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:133)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:314)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:60)
at b4a.example.b4xmainpage.callSub(b4xmainpage.java:169)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1098)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:528)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:865)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:199)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:206)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:716)
at b4a.example.main._activity_create(main.java:365)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: keyboard.png
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:103)
at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:124)
... 31 more
Caused by: java.io.FileNotFoundException: keyboard.png
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:347)
at android.content.res.AssetManager.open(AssetManager.java:321)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:208)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
at anywheresoftware.b4a.objects.drawable.BitmapDrawable.build(BitmapDrawable.java:69)
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:101)
... 32 more
b4xmainpage_b4xpage_created (java line: 60)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:155)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:314)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:60)
at b4a.example.b4xmainpage.callSub(b4xmainpage.java:169)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1098)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:528)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:865)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:199)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:206)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:716)
at b4a.example.main._activity_create(main.java:365)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:36)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:423)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:133)
... 24 more
If i add all the same views manually it works fine.
Am i not doing something correct ?
Thanks for any help.
[B4X] Sharing layouts between platforms
Sharing code between the platforms is quite simple with the reference modules feature: https://www.b4x.com/android/forum/threads/b4x-modules-files-groups-and-folders.86587/#content Once you learn how to use XUI library with B4XView and the various cross platform controls you can share 95%+ of...
www.b4x.com
I am working on a b4i/b4a app.
I noticed when i design the layout in b4i and then copy the views to b4a i get this error.
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create (first time) **
#SupportedOrientations attribute must be set to landscape or portrait.
*** mainpage: B4XPage_Created
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.DynamicBuilder.build(DynamicBuilder.java:38)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:338)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:133)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:314)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:60)
at b4a.example.b4xmainpage.callSub(b4xmainpage.java:169)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1098)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:528)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:865)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:199)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:206)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:716)
at b4a.example.main._activity_create(main.java:365)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
Caused by: java.lang.RuntimeException: java.io.FileNotFoundException: keyboard.png
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:103)
at anywheresoftware.b4a.objects.ImageViewWrapper.build(ImageViewWrapper.java:124)
... 31 more
Caused by: java.io.FileNotFoundException: keyboard.png
at android.content.res.AssetManager.openAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:347)
at android.content.res.AssetManager.open(AssetManager.java:321)
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:208)
at anywheresoftware.b4a.objects.drawable.CanvasWrapper$BitmapWrapper.Initialize(CanvasWrapper.java:516)
at anywheresoftware.b4a.objects.drawable.BitmapDrawable.build(BitmapDrawable.java:69)
at anywheresoftware.b4a.objects.ImageViewWrapper.setImage(ImageViewWrapper.java:101)
... 32 more
b4xmainpage_b4xpage_created (java line: 60)
java.lang.RuntimeException: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:155)
at anywheresoftware.b4a.objects.PanelWrapper.LoadLayout(PanelWrapper.java:134)
at anywheresoftware.b4a.objects.B4XViewWrapper.LoadLayout(B4XViewWrapper.java:314)
at b4a.example.b4xmainpage._b4xpage_created(b4xmainpage.java:60)
at b4a.example.b4xmainpage.callSub(b4xmainpage.java:169)
at anywheresoftware.b4a.keywords.Common.CallSub4(Common.java:1098)
at anywheresoftware.b4a.keywords.Common.CallSubNew2(Common.java:1069)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:528)
at b4a.example.b4xpagesmanager._showpage(b4xpagesmanager.java:865)
at b4a.example.b4xpagesmanager._addpage(b4xpagesmanager.java:199)
at b4a.example.b4xpagesmanager._addpageandcreate(b4xpagesmanager.java:206)
at b4a.example.b4xpagesmanager._initialize(b4xpagesmanager.java:716)
at b4a.example.main._activity_create(main.java:365)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:221)
at b4a.example.main.afterFirstLayout(main.java:105)
at b4a.example.main.access$000(main.java:17)
at b4a.example.main$WaitForLayout.run(main.java:83)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6176)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
Caused by: java.lang.RuntimeException: Object should first be initialized (ImageView).
Did you forget to call Activity.LoadLayout?
at anywheresoftware.b4a.AbsObjectWrapper.getObject(AbsObjectWrapper.java:67)
at anywheresoftware.b4a.objects.ViewWrapper.innerInitialize(ViewWrapper.java:73)
at anywheresoftware.b4a.objects.ImageViewWrapper.innerInitialize(ImageViewWrapper.java:36)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:423)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayoutHelper(LayoutBuilder.java:442)
at anywheresoftware.b4a.keywords.LayoutBuilder.loadLayout(LayoutBuilder.java:133)
... 24 more
If i add all the same views manually it works fine.
Am i not doing something correct ?
Thanks for any help.