Hard Coding in Native App

Hey hey party people, I wasn’t sure where to put this, I guess it’s mainly a bug I stumbled on rather than a question, but I wanted to get some form of documentation out there for it so if other people are experiencing something similar they will land here. Essentially what I got going on is I’m using the Native Builder (Native Builder 3) to build the shell of an application, then I’m using the MxBuild tool to package up that application with the --native-packager flag (I’m doing this manually to include a feature flag in the build process). Anyways, I experienced this weird thing where the app worked fine the first time in an emulator after loading it into android studio, but then I made some changes to the project’s Native navigation config. I just changed the default home page and Role Based home pages to point to my ‘Home_Native’ page. It wasn’t originally this way, mind you. I had originally made it so a separate page (Main_Native) was the home page.  Anyways, after this change it continued to hit the old home page first upon opening the app. So, I decided to change the names of the pages thinking it would mix something up and snap it out of it’s confusion. I was wrong… Instead it started to throw the below error: 2020-01-30 11:41:26.933 21817-21890/com.ondemand.hana.us10.cfapps.CustomerDrinkRedemption E/ReactNativeJS: 'undefined is not an object (evaluating \'e[n].navigation\')', 'index.android.bundle:12:25443\nxn@index.android.bundle:12:25557\nvalue@index.android.bundle:12:32027\nindex.android.bundle:12:494\np@index.android.bundle:21:423\nindex.android.bundle:21:1740\np@index.android.bundle:21:423\nn@index.android.bundle:21:898\nindex.android.bundle:21:1047\nf@index.android.bundle:117:155\nindex.android.bundle:117:882\ny@index.android.bundle:122:657\nC@index.android.bundle:122:1021\ncallImmediates@index.android.bundle:122:3216\ncallImmediates@[native code]\nvalue@index.android.bundle:50:2873\nindex.android.bundle:50:1264\nvalue@index.android.bundle:50:2565\nvalue@index.android.bundle:50:1234\nvalue@[native code]\nvalue@[native code]' I was kind of at my wits end so I started retracing my steps and returning the pages back to their original names. That’s when the error magically went away, but the issue with the app opening directly to the second page within the logic flow came back. That’s when I figured somewhere within the configuration of the app it had to have been accidentally hard coded to point to ‘Main_Native’ as the sole home page, despite configuring it differently from within Studio Pro. In order to fix it, I did a dirty fix for the time being and renamed the page I actually want to be the opening home page to ‘Main_Native’ and it worked like a charm. I don’t know if this has to do with some weird caching going on, or maybe a ghost in the shell – some kind of configuration of how it was originally stuck and didn’t pick up my changes despite countless saves and commits.  If anyone else runs into this problem, I’d love to hear if you find a solution or where the cause might be. I hope this helps you!  Buzz words: native cache, native caching, hard coded navigation, native navigation configuration stuuuuuuuuuuck
1 answers

Ticket 95101