Android crashes on Initialization.

To place the game onto the google play store. Do I not have to bring it into Android Studio? Now I feel like I’m all turned around. LOL If there’s an easier way I’ll take it.
I did not touch ProGuard and I’ll check the adb log and post.

Wow, it worked just uploading the apk directly to the play store. I was just following tutorials and thought I needed to bring the apk into Android studio as a google android project. So psyched. And Unity Ads worked. Thanks so much.

Hi,
I have a crash on Android directly related to the Unity Ads.
It was working fine 3 months ago builds(interestingly it doesn’t work with 3 months ago build now) and also it works fine with IOS.
I didn’t touch anything on the codeside of ads(rewarded videos) since it was working before.

Basicly, problem is that it crashes after I watch a video and press close button of the video.
It gives such error log among other messages but I believe this causes the crash:
[EGL] Unable to acquire context: EGL_BAD_NATIVE_WINDOW: A NativeWindowType argument does not refer to a valid native window.

I am building with Mono2x. It has some Prime31 plugins but nothing is updated since the working version instead of the Unity version that I use 5.3.4p1

Do you have any ideo what may cause the crash? If not, I can send the whole crash debug message.

Thanks

Hi! I have been experimenting, trying to get unity ads to work in my latest game on Android.
The issue I’m having is that as soon as a video is shown on the mobile, the app crashes and restarts. At most you can hear the ad sound for about 100-200ms before it crashes.
The project is an almost clean project with unity ads added. Unity ads has been set up according to all guides and the code implementation is straight from the examples.

The test ad shows perfectly in the editor.

logcat shows the following output when the ad is trying to show:

I/ActivityManager( 733): START u0 {flg=0x10010000 cmp=com.ByteSizedGames.ProductName/com.unity3d.ads.android.view.UnityAdsFullscreenActivity} from pid 10151
W/ActivityManager( 733): mDVFSHelper.acquire()
W/ActivityManager( 733): Permission Denial: getCurrentUser() from pid=10151, uid=10141 requires android.permission.INTERACT_ACROSS_USERS
I/ActivityManager( 733): Config changes=480 {0 1.0 240mcc2mnc en_US ldltr sw320dp w533dp h294dp 240dpi nrml long land finger -keyb/v/h -nav/h s.95}
I/ActivityManager( 733): Displayed com.ByteSizedGames.ProductName/com.unity3d.ads.android.view.UnityAdsFullscreenActivity: +522ms
W/ActivityManager( 733): mDVFSHelper.release()
I/ActivityManager( 733): Process com.ByteSizedGames.ProductName (pid 10151) (adj 0) has died.
W/ActivityManager( 733): Force removing ActivityRecord{42532330 u0 com.ByteSizedGames.ProductName/com.unity3d.ads.android.view.UnityAdsFullscreenActivity t51}: app died, no saved state

I have yet to find people with similar issues as mine online. In my research android.permission.INTERACT_ACROSS_USERS seems to be a permission normal developers can’t set by themselves. Is there anything I’m missing? Why would unity ads need the android.permission.INTERACT_ACROSS_USERS permission?

Using Unity v5.3.4f1 personal.

Best regards, Shiratori.

1 Like

What is the Android system version you’re seeing this issue with?

My test device is a Samsung Galaxy ace 4 running Android 4.4.4.

I had a theory regarding the crash since the call to getCurrentUser() seems to trigger the crash. My device had the details of two different google accounts on it. My main account, and a friends account used for testing google play services with another account than my own. I thought this might be a reason for the crash and removed the secondary account, However, no change was made regarding the issue with Unity Ads crashing.

Do you have any other plugins included in your project?

Just to eliminate any external influences, try importing the UnityAdsHelper asset package into a new Unity project. Then enable and configure the Ads service, and build it to device with the UnityAdsExample scene.

I haven’t seen this issue before, and I wasn’t able to find the getCurrentUser method anywhere in our source. I suspect it may be external to the Unity Ads SDK and our webview content.

Please let me know what the results are. If you are able to reproduce the issue, please send me a link to the APK.

I will try this today and come back to you!