UnityMain not showing in Systrace - android

I ran a Systrace and opened 2 Unity apps. I configured atrace to use these 2 categories: "am", and "view". However, when I go to view it in the trace viewer I see the Unity apps but I don't see UnityMain.
I tried using 2 additional categories: "gfx", and "input". But this time in the trace viewer I don't see Unity apps at all.
What is going on here? Here is Systrace for Unity for reference.

The solution was to target a specific Unity app by using Systrace's app flag --app=<name of unity package>. I used "am", and "view" categories.

Related

Dynamic instruction trace for Android Apps

I want to generate the dynamic instruction trace of Android Apps (Just like for a basic hello world C program, I am able to generate the instruction trace using the tools like Dynamorio, pintool).
I want to know at runtime, what are the address of the instruction which are getting executed? Is anyone aware of any existing tool which can help me in this?
I found out that there are existing tools like Dynamorio (support for Linux, Windows is there but for Android's ART environment, they are not), Pin tool (the last Android version they were supporting is the Icecream).
I also tried using https://perfetto.dev/ but they seem to capture the device activity.
In that, if I want to generate the dynamic instruction trace of Android Apps, I am unable to do so.
Is anyone aware of any tool which seems to generate the dynamic instruction trace for Android Apps?
Any response from your side will be highly appreciated and will help in my project.

How to find the reason my app stopped without Android Studio

I just finished my last app and after intensive testing on android studio no bugs or errors pooped up.
But when I use my phone for some time and try to check my app it crashes, and error pops up.
Is there a way to find out the stack trace od that error? specially since its not connected to my PC.
You can integrate tools for analyse, like:
Crashlytics
So you have a dashboard and can setting a e-mail for warning.
You can use different options:
Store logcat file in Internal memory as txt file. This will be best solution since it will provide all the necessary information of pre-conditons for the crash
Implement crashanalytics like Hockeyapp
Use remote debugging. Refer this official document for more info
You can find more details for approach 1 & 2 at: remote logcat - Android Studio

Import Unity Classes into Existing Android Project

As the title says, I have an existing Android project and I want to import Unity classes.jar so I can access the UnityPlayer.UnitySendMessage.
I found this other question with similar goal, but the answers were unintelligible or unhelpful.
I also found this on the Unity forums, but it is apparently very outdated (2011).
Essentially, all I'm trying to do is:
Open up an Android application.
Select which scene (or, preferably, more than one scene) I want to view from the Unity app.
Launch the Unity GearVR application.
Play the selected scene(s).
I've already got steps 1 and 3 working, and steps 2 and 4 I'm making work by loading each scene up as a different APK and launching a specific APK depending on which scene I want to view, but, ideally, I could host all the scenes in a single application so I could then watch several off the scenes in a row (and also so I could cut down significantly on memory usage).
I've found some tutorials on using UnityPlayer.UnitySendMessage, so I think I can get it working if I can only get Android Studio to recognize and use UnityPlayer.UnitySendMessage, but if you have any other ideas, I appreciate those as well!
I've found some tutorials on using UnityPlayer.UnitySendMessage, so I
think I can get it working if I can only get Android Studio to
recognize and use UnityPlayer.UnitySendMessage
Get classes.jar from one of the sub-folders from
<UnityInstallationDirectory>\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\mono
or
<UnityInstallationDirectory>\Editor\Data\PlaybackEngines\AndroidPlayer\Variations\il2cpp
depending on if you are using mono or IL2CPP as Scripting Backend to build your Android Project.
Import it into Android Studio. Right-click on it and click Add As library and Android Studio should add it as library. See this if you are still confused. You can now use UnityPlayer.UnitySendMessage.
As for the rest of your question, I think that you should look into this answer. It explains how you can show Unity scene in a sub-view. That is another way to get what you want.

Google Cardboard Can't Call onNewFrame

I just bought a Google Cardboard Viewer and decided to take a shot at making an app. I have played around with OpenGL and have no problem with the basics of that.
I created a new project following the source from the only sample I could find "Treasure Hunt" linked to from the "Getting Started" for Cardboard.
I can run my own test application and the Treasure Hunt sample application from Google on my Nexus 7 tablet, but I get an error on my phone:
JNI DETECTED ERROR IN APPLICATION: can't call void com.google.vrtoolkit.cardboard.CardboardView$StereoRenderer.onNewFrame(com.google.vrtoolkit.cardboard.HeadTransform) on instance of my.app.cardboardtest.CardboardRenderer
Since I get the same error from the sample from Google, I don't think I need to share any of my code specifically. This is a link to their code:
https://github.com/googlesamples/cardboard-java
I have a T-Mobile Galaxy Note 3 running Android 5.0
Is this the final tipping point for me to upgrade my phone? lol
This seems to be a problem with your build in Android Studio.
Try moving the cardboard.jar file (that contains the vrtoolkit.so binary) to a folder called /lib and point to it.
Upshot is, android cannot find vrtoolkit.so in the delployed apk. The binary is a new addition to the jar, and the docs are older than that.
Or, just stick with Eclipse until Studio is a little more rattled in.
Just a headsup the learning curves around VR development are turbulent like the event horizon of a black hole ...

wrapped android-app crashes on resume "no current context"

i got a webapp build via flambe/haxe which is wrapped by phonegap build to get an .ipa and .apk. For now the only remaining error is that the app looses its context if i switch between apps or pressing home-button resulting in the following error on android:
"W/Adreno200-EGL(31381): <qeglDrvAPI_eglSetBlobCacheFuncsQCOM:5575>: EGL_BAD_PARAMETER"
"E/libEGL(31381): eglSetBlobCacheFuncsANDROID resulted in an error: 0x300c"
"E/SurfaceTexture(31381): [unnamed-31381-1] updateTexImage: invalid current EGLContext"
"E/CanvasTexture(31381): unexpected error: updateTexImage return -38"
The last two lines keep repeating (even after several minutes) until i close the app manually which results in the following error-message:
"E/libEGL(21636): call to OpenGL ES API with no current context (logged once per thread)"
Full errorlog can be viewed here: http://goo.gl/UkxwfI (Dropbox)
One thing that keeps bugging me is the following message since all "related" problems got that feature turned ON, but i cant find anything to change that.
"D/webcoreglue(31381): netstack: Memory Cache feature is OFF"
Another thing is with: D/CordovaActivity(31381): CB-3064: The errorUrl is null
As of http://goo.gl/qZWc4F (github) there seems to be a problem on resuming in cordova. (just strg+f "cb-3064")
Took me the whole day to use google on terms like:
EGL_BAD_PARAMETER, qeglDrvAPI_eglSetBlobCacheFuncsQCOM, SurfaceTexture, CanvasTexture, updateTexImage, invalid current EGLContext, eglSetBlobCacheFuncsANDROID, error: 0x300c, OpenGL ES API
but without any good hints or helpful info.
additional information:
tested on Sony Xperia J (ST26i) and android 4.1.2
min android SDK 14
android:hardwareAccelerated="true" (default since sdk 14)
landscape + fullscreen
webview used to display the website coming from flambe/haxe
used build phonegap / phonegap 3.3 (using 2.8 - 3.3 = same)
building it myself via cordova doesnt help (so it should not relate to phonegap build)
cordova.inappbrowser only used to open links in external browser, website running in webview
website only shows a html5-game (nothing fancy, just something like bejeweld)
Maybe there's some easy help by juggling with the Android-Manifest. I really dont want to do native since the webapp is shipped to iOS via Phonegap too.
Update 1
Tried to reproduce the error using native android and playing with different manifest-settings. But it seems like this has something to do with how phonegap/cordova handles the drawing of everything on screen.
Next things to do will involve posting on phonegap-forums and checking out iOS errorlog. Maybe i find something while comparing my results to: iOS app crashes on resuming
Update 2
iOS-Errorlog doesn't help. Exception Type 20 and Exception Code 8badf00d. Stack shows errors with graphics too (like in android). Errorlog see Link in Comment...
"Fixed" by building android and ios myself with cordova. Resuming/Restarting feels a bit bumpy but thats the next thing to fix.
Phonegap build just doesn't like the life cycle of apps.

Categories

Resources