-
Notifications
You must be signed in to change notification settings - Fork 538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modifying the code and running a Xamarin.Android application doesn't work fine #6113
Comments
Sometimes is necessary to uninstall the application from the emulator. |
Thanks for the bug report. We will try to repo this issue locally, but it would be very helpful if you could provide some diagnostic build output. You can get the required output using the steps below.
Attach back the text files from steps 4 and 6 in a new comment on this item, You can zip the files before attaching them to make the upload size smaller. If you could provide both the Build and Deploy logs that would be helpful. The Deploy logs are really important. If you are comfortable using the VS2019 Developer command prompt an easier way to get the logs all in one go is to run the following command
Then attach the resulting Thanks in advance |
I attached the requested output files and include others just in case. |
I also tried the command
|
@arivoir sorry there was a typo in my post, the target is |
can you try using the following
This will enabled the fast dev diagnostic logging. I suspect you hare hitting an issue which we might have fixed internally already. |
Good point. |
This one includes |
@dellis1972 I think @PureWeen was hitting this, and we thought this change fixed it: Our test case was changing a @arivoir if you make a larger change, do you see you're changes depoyed? Something like |
@jonathanpeppers yup that was the fix I was thinking about. |
@jonathanpeppers Adding |
@arivoir can you share a log when you make that change? We shouldn't be seeing a log message like this:
But we should be able to see what it thought the timestamp of the file on the device was. |
It's probably the same issue. We had an issue with the time stamps that were being returned from our native fast deployment tooling. On x86 based CPU's the time stamp from the device was different from what it should have been, we suspect it was down to an arithmetic overflow of some sort because we were dealing with 64bit ints. |
@jonathanpeppers this #6113 (comment) has the data. But its an older version so it doesn't have the additional logging we added for P7. |
@jonathanpeppers I uploaded the logs here #6113 (comment) |
Can I make anything to get the timestamp? Please give me instructions |
What For all we know, there might have been no changes. We don't have that detail here. |
I'm changing the MainActivity.cs of the project, but I've had this problem in other parts of the code. I'm sure the source is changes, because if I delete the application from the emulator and run it again I can see the changes. |
Can you share an example of what you changed? I will try to repro it with xamarin-android/main (preview 7). |
Will a "Live share" work for this? |
A C# code snippet is all we need, for example: --var button = FindViewById<Button> (Resource.Id.myButton);
++var button = FindViewById<Button> (Resource.Id.anotherButton); I have no idea if the above causes the issue, or what kind of code changes does. |
In this particular case I was working on, I'm setting the Foreground of TextView
Commenting it out will not make the foreground to appear, unless I remove the app from the emulator |
I was able to reproduce the issue in a very simple project Created an empty project Added an id to the TextView Then in MainActivity I set the foreground programmatically, it works fine, but then I comment out that code and the textbox is still green If I remove the app from the emulator and run it again, I can see the textview without the foreground. |
I get a different issue with that test project on |
I just tried with a real device and the problem didn't appear, but developing with the emulator is crucial. I hope you can fix it. |
@arivoir ok so I did a review of our code and I think I figured out what is going on. I suspect your emulator is an x86_64 one, not a standard x86 one. The problem here is we are deploying the x86 fast dev tooling to the emulator not the x86_64 versions we should be. What we normally do is run a task called The problem with .net 6 is we filter the So in theory adding the following to your csproj will work around the issue <RuntimeIdentifiers>android-arm64;android-x64</RuntimeIdentifiers> Assuming you want to use 64bit on both device and emulator. you will need to do a complete clean for this work around to work, and probably remove the app from the device as well just to make sure everything gets updated. |
I tired that and got this
I suppose it is because of this What should I change? the emulator processor? I appreciate if you can orient me. |
Err ok. very weird. So we have a problem , but it's not the one you are getting. |
Why did you closed it? When are the bugs going to be fixed? |
We just merged a PR with the fix (change is in a private repo). The plan is for this to land in Preview 7. |
Perfect! I'll test it when it is released. Thanks. |
Fixes: dotnet#6113 Changes: xamarin/monodroid@33e542f...ab6c39e * xamarin/monodroid@ab6c39ee5: [tools/fastdev] use strtoull to parse 64 bit argument. (dotnet#1217) * xamarin/monodroid@aa75b5b89: [tools/msbuild] Cache the ToolsAbi value for the device. (dotnet#1216) * xamarin/monodroid@d4a8977cb: [tools/msbuild] add missing RuntimeConfigBinFilePath value (dotnet#1213)
Fixes: #6113 Changes: xamarin/monodroid@33e542f...ab6c39e * xamarin/monodroid@ab6c39ee5: [tools/fastdev] use strtoull to parse 64 bit argument. (#1217) * xamarin/monodroid@aa75b5b89: [tools/msbuild] Cache the ToolsAbi value for the device. (#1216) * xamarin/monodroid@d4a8977cb: [tools/msbuild] add missing RuntimeConfigBinFilePath value (#1213)
Fixes: #6113 Changes: xamarin/monodroid@33e542f...ab6c39e * xamarin/monodroid@ab6c39ee5: [tools/fastdev] use strtoull to parse 64 bit argument. (#1217) * xamarin/monodroid@aa75b5b89: [tools/msbuild] Cache the ToolsAbi value for the device. (#1216) * xamarin/monodroid@d4a8977cb: [tools/msbuild] add missing RuntimeConfigBinFilePath value (#1213)
In many occasions it happens I modify the code of the application I'm building and when I run the application, the running application is old and it doesn't contain my changes.
Rebuilding the application doesn't fix it.
The only way of fixing it is to delete bin and obj folders and run the application again
The text was updated successfully, but these errors were encountered: