I am new in Android and I faced to a problem. I use android studio 2.3, and everything was fine. But after some time, i spotted that an app hangs while i debug. It freeze and works pretty slow. If i turn off debug the app works fine. I tried to clean cach on device and studio but it did not help. I set the my laptop aside and continued work on other pc. In the beginning everything was good but problem returns. I cant figure out the reason and fix it. Has anybody face same problem?
Проблема приложение тормозит во время отладки. Без оной работает нормально. Продолжил работать за другим pc и все было хорошо сперва, но проблема вернулась. Пробовал чистить кешь, удалять но не помогает. Как с этим бороться?
As WieFel wrote, debugger will obviously stop at any breakpoints you created. Make sure that you are not setting your breakpoints on whole methods, as it can cause your debugger to be incredibly slow. Breakpoints should be ideally targeted at single lines of code. You can see all of the breakpoints you've set by Run... -> View Breakpoints or Cmd/Ctrl + Shift + F8.
If you are in debug mode, the app stops at the breakpoints you have set in your code. This gives you the opportunity to look at the variable values at that point in code.
To continue the execution you have to click on the green resume button on the top left of the debug view. -> image:
enter image description here
Related
The game freezes permanently when I try to load the next scene but when I load it with "Additive" mode it's loaded fine (using SceneManager.LoadScene("NextScene", LoadSceneMode.Additive)).
In editor everything works even with mode "Single", the problem only appears with Android.
I don't want to use the "Additive" mode because it loads the content of the new scene above the old one.
I try:
using "adb logcat" to see if any exception occurs but there are no exceptions.
load an empty scene as a new scene but the problem still appears.
load using SceneManager.LoadSceneAsync("NextScene") but the problem still appear.
load with "Additive" mode and after the next scene is loaded I try to Unload the old scene using SceneManager.UnloadScene("OldScene") but it freezes again.
So the problem appears when Unity try to unload the old scene.
(I use Unity 2018.4.10f1 LTS).
Thanks in advance for any help.
Try to delete the objects from the last scene
In for loop to see what object response for the error
I try to build the game with PC and I face the same problem.
I see what in the output_log.txt file in "C:/Users/.../AppData/Local/Temp/.../My game name/Crashes" and the first readable messages after the crash are like this:
"ERROR: SymGetSymFromAddr64, GetLastError: 'Attempt to access invalid address.' (Address: 00007FFEF20E5212)"
without any other errors or exceptions by my game,
so I try to test the game with an updated version of Unity (2018.4.10f1 --> 2018.4.20f1),
Abracadabra everything works fine with the new version!!
and the problem doesn't appear anymore!!
I think it was a memory management problem in Unity 2018.4.10f1 but I don't know why.
My Cardboard-like VR-Viewer has a button that works by touching the screen. I created an app in Unity3D and this trigger mechanic first worked like a charm. Now all of a sudden, I think I only added an explosion particle effect, the touch function stopped working completely. I have tried things like removing the explosion from my scene again, but nothing seems to work. Another curious thing is, that I can't close the app in a normal way anymore (normally in VR Apps you have an X-Button in the top left of your screen, but clicking it doesn't do anything anymore too (It used to work!)). App still runs, doesn't crash, but no interaction is possible. I looked at the debug logs via adb - no errors there... App works like it used to when I start it inside the Unity Editor.
Did someone encounter a similar error or may have an idea about what the problem is? I'm using Unity Daydream Preview 5.4.2f2.
Edit: I forgot to mention I was using GvrViewer.Instance.Triggered to check if the screen was touched.
For all having the same problem, I worked around it by also checking if a touch just happened. In my Player : Monobehaviour I used:
void Update()
{
if (GvrViewer.Instance.Triggered ||
Input.touchCount > 0 && Input.touches[0].phase == TouchPhase.Ended)
{
//Do stuff.
}
}
I was trying to make something in Adobe Flash, Air for android. I simply made a square and converted it to an Symbol (called 'hello') and I entered this code.
Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
hello.addEventListener(TouchEvent.TOUCH_TAP, tap);
function tap(event:TouchEvent):void
{
hello.x+=15;
}
but nothing happend. I even used CODE SNIPPERS, and also tested this on my phone(ALCATEL onetouch idol mini), and it also said that there are no errors.What have I done wrong?
You set everything correctly but forget only one important thing: check if the system supports touchevent.
if(Multitouch.supportsTouchEvent)
I'm getting a very weird error ever since I have "ported" the spritebatch code from Nokia's site. It runs well as a desktop applcation emulated by POWERVR. But on Android I only get a blank screen (in fact its black.) This happens if I just try to display a image, but it doesn't crash.
Here is where comes the weird part comes in: if i put glGeterror(); in the update function it works fine! (slowly, but displays everything fine) and geterror code returns 0. I have no idea what is going on or how to debug it, as I'm new to OpenGL but everything looks correct in the source. I spitted geterrors all around the code but without any clue. I've attached my project if you want to take a look. You will need Visual Studio + vsandroid to compile.
apparently the problem is not on the sprite batch, but in the java code. I replaced for another one that uses surface view and no longer im getting this esotheric behavior.
Ok so I've finally cobbled enough working parts into my app that its just plain old refusing to do anything now. I understand how to use logcat, but that is about it.
The main problem at the moment is that I get the error
Activity Idle Timeout for HistoryRecord then my package
I need to learn how to do better debugging. Plus if anyone can suggest things I should do for this error please let me know.
I think its something to do with the interactions with the database.
Cheers
EDIT:
What IDE are you using, if any?
Eclipse with Android tool has
moderately good debugging facilities;
set a breakpoint and debug away.
I am using Eclipse
And I know of breakpoints, but not their real use. Where would I set them for this error?
I am used to PHP where errors tell you a specific line to look at is there a way to do this in Eclipse?
In Eclipse if you right click in the margin next to your code - easy place to start is probably in your onCreate method - you can choose to Toggle Breakpoint. This will set a breakpoint at that location.
Now, in Eclipse choose Run->Debug As->Android Application.
This will run your app in the emulator and your app with stop running at your breakpoint. At this point you can step thru your code line by line using F6 I believe.
Once you've hit the breakpoint and your code is paused, use a guide like this http://www.ibm.com/developerworks/library/os-ecbug/ which will highlight all the different things you can do at that point.
Max... If you can wrap the offending line of code in try catch you can log the exception or set a breakpoint at the exception. So for the code below that will throw an exception:
String test= null;
try {
test.length();
}
catch (Exception e) {
Log.d(TAG,"test",e);
}
LogCat will display test,java.lang.NullPointerException blah, blah, blah
OR you can set a breakpoint at the Log.d line and if hit in DEBUG mode the app will pause and the variable window in the DEBUG view will show:
this:MyApp e:NullPointerException
BUT it does not sound like your app is throwing an exception, rather it is timing out on a database call. I would stub out the call to the database and see if the timeout goes away. Then slowly add back code until it times out.
JAL