0

I am integrating AdMob Unity plugin with my Unity Game. My game works fine after publishing the .apk on my test device. But on initializing AdMob I am getting following log which has errors:

2019-09-09 17:19:01.083 32714-32738/? I/Unity: AdMob Init() called.

    (Filename: ./Runtime/Export/Debug/Debug.bindings.h Line: 48)
2019-09-09 17:19:01.231 32714-32738/? I/Ads: Updating ad debug logging enablement.
2019-09-09 17:19:01.245 32714-449/? W/Ads: Update ad debug logging enablement as false
2019-09-09 17:19:01.256 32714-32714/? I/WebViewFactory: Loading com.google.android.webview version 76.0.3809.132 (code 380913235)
2019-09-09 17:19:01.354 32714-32714/? I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 2360-2361)
2019-09-09 17:19:01.372 32714-32714/? I/chromium: [INFO:library_loader_hooks.cc(51)] Chromium logging enabled: level = 0, default verbosity = 0
2019-09-09 17:19:01.372 32714-32714/? I/cr_LibraryLoader: Expected native library version number "76.0.3809.132", actual native library version number "76.0.3809.132"
2019-09-09 17:19:01.396 32714-456/? W/cr_ChildProcLH: Create a new ChildConnectionAllocator with package name = com.google.android.webview, sandboxed = true
2019-09-09 17:19:01.403 32714-32714/? I/cr_BrowserStartup: Initializing chromium process, singleProcess=false
2019-09-09 17:19:01.415 464-464/? E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99752: Permission denied
2019-09-09 17:19:01.415 464-464/? E/Zygote: createProcessGroup(99752, 0) failed: Permission denied
2019-09-09 17:19:01.436 2987-8127/? I/ActivityManager: Start proc 464:com.google.android.webview:sandboxed_process0/u0i752 for webview_service com.techsanskriti.thearcher/org.chromium.content.app.SandboxedProcessService0
2019-09-09 17:19:01.440 32714-32714/? W/kriti.thearcher: type=1400 audit(0.0:45571): avc: denied { read } for name="vmstat" dev="proc" ino=4026546034 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0
2019-09-09 17:19:01.468 494-494/? E/asset: setgid: Operation not permitted

Following are the filtered lines having Error:

2019-09-09 17:19:01.415 464-464/? E//system/bin/webview_zygote32: Failed to make and chown /acct/uid_99752: Permission denied
2019-09-09 17:19:01.415 464-464/? E/Zygote: createProcessGroup(99752, 0) failed: Permission denied

2019-09-09 17:19:01.468 494-494/? E/asset: setgid: Operation not permitted

Below is the AndroidManifest.xml generated:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.abc.xyz" xmlns:tools="http://schemas.android.com/tools" android:installLocation="preferExternal">
  <supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
  <application android:theme="@style/UnityThemeSelector" android:icon="@mipmap/app_icon" android:label="@string/app_name">
    <activity android:name="com.unity3d.player.UnityPlayerActivity" android:label="@string/app_name" android:screenOrientation="landscape" android:launchMode="singleTask" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:hardwareAccelerated="false">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
      <meta-data android:name="unityplayer.UnityActivity" android:value="true" />
      <meta-data android:name="android.notch_support" android:value="true" />
      <meta-data android:name="android.notch_support" android:value="true" />
      <meta-data android:name="android.notch_support" android:value="true" />
    </activity>
    <meta-data android:name="unity.build-id" android:value="xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" />
    <meta-data android:name="unity.splash-mode" android:value="0" />
    <meta-data android:name="unity.splash-enable" android:value="True" />
    <meta-data android:name="notch.config" android:value="portrait|landscape" />
    <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-xxxxxxxxxxx~xxxxxxxxxxxx" />
  </application>
  <uses-feature android:glEsVersion="0x00020000" />
  <uses-feature android:name="android.hardware.vulkan" android:required="false" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-feature android:name="android.hardware.touchscreen" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
  <uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
</manifest>

Thanks in advance for any help.

Abhay Kumar
  • 522
  • 3
  • 9
  • 1
    The error seems quite clear, you do not have permission to make make and change the owner of the file. – BugFinder Sep 09 '19 at 12:25
  • I am just Initializing the AdMob, though my App also have WRITE_EXTERNAL_STORAGE permission. What else I need to do get this resolved? – Abhay Kumar Sep 09 '19 at 12:34
  • permissions to /acct ? – BugFinder Sep 09 '19 at 12:37
  • It would be really helpful if you please point the exact permission required in the Android App to make this working? – Abhay Kumar Sep 09 '19 at 12:39
  • I dont make android apps – BugFinder Sep 09 '19 at 12:56
  • Does your Android device respect the "Minimum API level"? (Inside Unity, Edit > Project Settings > Player > Android icon > Other Settings > Identification) – Tiago Martins Peres Sep 09 '19 at 13:09
  • The minimum API level in the Unity project is "API level 16" and target API level is set to "Automatic (highest installed)". My test device is Nexus-5x having Android Version 8.1.0 (API level 27). – Abhay Kumar Sep 09 '19 at 13:18
  • Because you're using API level 27, which is greater or equal to 23, you have to request permission at runtime - [read here](https://developer.android.com/training/permissions/requesting.html). Are you doing it? – Tiago Martins Peres Sep 09 '19 at 13:36
  • Following permission are available: INTERNET,ACCESS_NETWORK_STATE, WRITE_EXTERNAL_STORAGE, READ_EXTERNAL_STORAGE. For storage permission I am explicitly asking at runtime. – Abhay Kumar Sep 09 '19 at 13:39
  • The dialog appears and you click "Allow"? – Tiago Martins Peres Sep 09 '19 at 13:52
  • I reckon yes, so can you edit the question to include the information of the [resulting Android Manifest](https://docs.unity3d.com/Manual/android-manifest.html)? (open the Temp/StagingArea/AndroidManifest.xml file after you have built your Project but before exiting the Unity Editor) – Tiago Martins Peres Sep 09 '19 at 14:04
  • Updated question with the Android Manifest. – Abhay Kumar Sep 09 '19 at 14:17
  • Some report having external problems and had to [edit the manifest file](https://stackoverflow.com/a/43293396/5675325). Here are two examples of what they did: https://stackoverflow.com/a/48264971/5675325 and https://stackoverflow.com/a/49709872/5675325 . Maybe that can help you. – Tiago Martins Peres Sep 09 '19 at 14:42

0 Answers0