Repro steps:
Run a Launcher implemented in Xamarin.Android in debug mode.
Put a breakpoint on OnDestroy method override.
Open Google Maps. Start the navigation
Press home button which will try to open the launcher ui back up.
As soon as I do that, the breakpoint in OnDestroy hits followed by breakpoint in "OnCreate" and then once more "OnDestroy" followed by "OnCreate".
It is causing the whole launcher to practically restart not only once, but twice.
I even commented out every single piece of code from MainActivity OnCreate to have nothing in there just to make sure that is not my code, but it is still the exact same behavior.
Ideally, I would to see no "OnDestroy" call. Any thoughts...
Found the answer after many trials and errors.
Add ConfigChanges.UiMode flag to the
ConfigurationChanges attribute for your MainActivity class, and this solves the problem, and Launcher does not restart anymore.
Related
I have a trivial react component that only shows a button:
<Button onPress={() => console.log("test")} title="Button"/>
When I put this button into a project I created with react-native init, it works as expected.
However, I have an existing project into which I integrated React Native (0.51.0) manually (because it doesn't use cocoa pods; I followed this guide: https://medium.com/#joshyhargreaves/adding-react-native-to-existing-ios-project-without-cocoapods-6f1ee9106009).
The project seems to work fine: the UI loads, the button gives visual feedback when I tap it. But the buttons onPress event is not fired, so it does not log anything.
There are no errors or warnings (except Class RCTCxxModule was not exported, but it seems to be safe to ignore this).
I'm now out of ideas of what I could try or how I could debug this issue short of diving into Reacts touch handling code. Here's what I tried:
Made sure to only have one RCTRootView, and that it is created in the main thread.
Checked for any suspicious things happening in the remote debugger; everything looks normal (no exceptions thrown or warnings logged).
Tested a few other components that should fire events; for example, TouchableOpacity does not work either.
Logging something after a timeout does work, so it doesn't seem like anything is deallocated prematurely
Checking for errors reported by the metro bundler: it doesn't print anything
Any ideas on what I need to do to get my button to print "test" when I tap it?
I think you have not Debug JS Remotely option enabled. If you don't you have to open React Native Debug Menu Pressing (command / control) + D or shake your device if you are debugging with real device. Then just press Debug JS Remotely and it should appear in the Google Chrome. Then inspect and open the console. There it is!
This mite caused by date diff between the host (your computer) and the client (the mobile device)
You can check this by running adb shell "date" && date
to see if there is a diff.
If there is one go to your mobile device and toggle automatic date & time off and back on.
Then test time diff again as mentioned, if there is no more diff, tap events should work in debug mode
More details in the original git issue answer by - Alex Ciarlillo
My app has crashed telling that he index is out range when I use this team[1] which is surprising because it should have 2 strings in it. I have looked everywhere, in XCODE and the internet, but cannot find a way to see what the team array looks like. Is there anyway to see this? Thanks so much!
click on the left side of your line of code which contains (team[1]) to create a breakpoint.
Then run your app. When it reaches that point it will stop executing so you can check what is going on.
Here is an screenshot on how debugging looks like
You can see your array content in the "variables view"
There is also an example of "po" command on the "console" section
If you just want to use a breakpoint everytime your app crashes just add an exception breakpoint. This should show you where your code crashes and stop just before so you can find out what happened
I'm trying to track down a bug in an app which logs an error in the simulator, but doesn't crash in the simulator or on my testing device. I think I've got a handle on what to do once I can figure out where the problematic code is located, but I'm having a heck of a time figuring out what call is generating it.
CoreData: error: Failed to call designated initializer on NSManagedObject class "OneOfMyManagedObjects"
I'd like to add a breakpoint that stops execution on that error. How would I set the breakpoint navigator to stop execution when that error is logged in the console?
What I've Tried:
So far, I threw some log statements in AppDelegate.swift and the initial ViewController to "see what's going on". Additionally, I've thrown in some manual breakpoints in hopes of tracking down the issue that's generating the console error, but it's taking forever and a day to step through everything. Given the issue lives somewhere between AppDelegate and viewDidLoad of the initial ViewController, I'm baffled why it's taking me so long to spot the problem.
I've added an exception breakpoint for all exceptions in the breakpoint navigator, but this error doesn't appear to be enough to stop execution. I do think it's enough to cause a problem for a minority of users, which is why I'm trying to clean it up.
Special thanks to pbasdf for pointing me in the right direction.
My app uses a TabBarController with 4 tabs. The initial tab is tab 0, so I was looking for a problem between AppDelegate.swift and InitialVC's viewDidLoad. In reality, my problem lived on Tab3ViewController where OneOfMyManagedObjects are displayed.
I had a global variable set on Tab3ViewController that looked like this:
// this was the problem
var oneOfMyManagedObjectsToEdit = OneOfMyManagedObjects()
// I changed it to this and the error went away
var oneOfMyManagedObjectsToEdit: OneOfMyManagedObjects?
Thank you for pointing me in the right direction towards resolution of this problem.
Team,
I am working on a project which is on Titanium, I am facing one small issues which i cannot find the solution, The issue is
In Index.xml file i am writing code for Tabbar, Writing the click action the tag but in iOS that method is not calling, Where as in Android it is working fine, Dont know whats wrong, Below is the code i wrote.
<Tab id="tab4" title="Coverage" icon="/images/Coverage_tab_n.png" onClick="displayCoverage" class="bcPurple_iOS">
<Window id="win4" title="Coverage" top="20" bottom="20" class="bcPurple_iOS">
</Window>
</Tab>
The onClick action code i am writing in the index.js file which is deault,Am i doing any wrong.
This is a feature request in Titanium TIMOB-6499 It was requested to be added in Android and was but hasn't been added in iOS yet.
Work around could be to use onFocus which works but might not be exactly what you want as it runs when the tabgroup opens. To avoid that, you could set a variable to stop it running on the first load I suppose.
If you're into compiling from source, there is a quick fix from someone in comment thread in the link above which may or may not work.
The feature request has been open since Dec 2011 and is marked as low priority.
I had a perfectly well running asp.net mvc application and I was debugging message sending via SignalRand I decided to stop debugging and went to edit some code. However, there was an error saying something about IIS termination and whether I want to do that because something (I assume - the application) cannot be stopped. (I am really sorry, but I didn't read it at the time). So now I try to relaunch my program and it just won't open. The website is trying to be opened but the loading circle in chrome just kept on spinning forever.
What I tried to do was:
1. restarted VS - didn't help
2. restarted PC - didn't help
3. created a new project, brought all files to it and launched it and it worked!
So then it worked for ~10 minutes or so and then just stopped again (this time no error message or anything). I tried changing a port in the settings of the project. Didn't work. Tried changing back and it launched successfully. For a minute or so... :(
So finally, I tried putting a break point right at the
public class MvcApplication : System.Web.HttpApplication
{
protected void Application_Start()
-> {
The breakpoint was hit, it successfully passed the next line
RouteTable.Routes.MapHubs();
and just disappeared at
AreaRegistration.RegisterAllAreas();
Many times I tried and it always disappears at the same location. Going deeper is not an option since this is system method. I suspect something can be problematic with that, but I am not experienced with much configuration of asp.net.
P.S. many times VS was acting strange and even tho I set the breakpoint at the place I marked above, it showed the breakpoint with a message that it won't be hit because the source differs from the current code (But I didn't change a thing since before the very first crash! The only place I modified a few symbols at was at MyHub.cs which is an extended class for a Hub for SignalR)
Lastly, I tried deleting everything from bin folder so it got fully rebuilt, but without any success to revive my application.
What could be a possible problem, maybe someone had anything at least similar to this? Or maybe someone would be kind to help me at choosing better keywords while searching in google because "IIS termination" and "AreaRegistration.RegisterAllAreas(); not working" didn't bring me much :(
This is a known bug: https://github.com/SignalR/SignalR/issues/1335.
We have been unable to successfully reproduce this issue on our servers. We've seen that using a different web server will resolve the issue. If you're able to post a reproduction project to the linked Issue, chances are it will be resolved promptly.
Apparently, the solution I marked isn't the exact thing that helped me. This link was the thing that miraculously helped me and I was able to finally get back to work. However, I found the winning link because of N. Taylor Mullen, so he deserves the full credit :) But letting others know if anyone comes to this question :)