# Android API 23 XAPK validation failed due to OBB permissions

**URL:** <https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212>\
**Category:** Mobile\
**Tags:** apk, obb, permission, unreal-engine, Android, question\
**Created:** [August 3, 2017, 10:07am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212 "2017-08-03T10:07:17Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [August 3, 2017, 10:07am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/1 "2017-08-03T10:07:17Z")

</div>

Hi,

Android 6 devices are getting XAPK validation failed on start up while validating the game OBB as it requires Storage permission to read it. When the device gets restarted the game opens normally without the need of any permissions this is due to the fact that it puts the obb under root user before restart and adjusts the user after restart. There is a bug currently opened on Android for this [Google Issue Tracker](https://issuetracker.google.com/issues/37544273)

I have published my game with Target API 23 and Google Play Console does not allow to lower it so I am stuck with it now but can’t market the game due to this issue. Is there any workaround for this ?

---

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [August 4, 2017, 7:58pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/2 "2017-08-04T19:58:10Z")

</div>

Any help for this ?

---

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [August 8, 2017, 9:16pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/3 "2017-08-08T21:16:42Z")

</div>

I have edited DownloaderActivity.java.template to request for Storage access permission request at first if not granted as temp solution… is there any workarounds else to fix this problem without requesting “dangerous permissions” ?

Thanks.

---

<div class="post-metadata">

**Author:** ![iscaru1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iscaru1988](https://forums.unrealengine.com/u/iscaru1988)\
**Post date:** [September 19, 2017, 10:21am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/4 "2017-09-19T10:21:52Z")

</div>

Hi I’m having the same trouble, but I have never programmed in java.  
Would you please tell me what change did you made to fix this issue.  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![SlayerScheta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SlayerScheta](https://forums.unrealengine.com/u/SlayerScheta)\
**Post date:** [September 21, 2017, 8:08am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/5 "2017-09-21T08:08:52Z")

</div>

I am also curious what changes you made for this.

---

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [September 21, 2017, 11:35am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/6 "2017-09-21T11:35:53Z")

</div>

I am traveling away right now, I will post this solution changes tomorrow when I get back

---

<div class="post-metadata">

**Author:** ![iscaru1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iscaru1988](https://forums.unrealengine.com/u/iscaru1988)\
**Post date:** [September 21, 2017, 11:39am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/7 "2017-09-21T11:39:52Z")

</div>

THANK YOU SO MUCH! 🙂

---

<div class="post-metadata">

**Author:** ![SlayerScheta](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SlayerScheta](https://forums.unrealengine.com/u/SlayerScheta)\
**Post date:** [September 24, 2017, 2:54pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/8 "2017-09-24T14:54:30Z")

</div>

Thank you for helping. I look forward to the fix as well

---

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [October 4, 2017, 11:30pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/9 "2017-10-04T23:30:17Z")

</div>

So sorry for the late response, here is what I have done…

I have edited DownloaderActivity.java.template which is mostly located in C:\Program Files\Epic Games\UE\_4.16\Engine\Build\Android\Java\JavaTemplates

- Created a new Java method called doOnCreate()

- Took all the contents of **onCreate** method, pasted them into **doOnCreate()** and called it from onCreate

- In method **doOnCreate()** I have added the following code on top to request for Write permission if it was not already granted

- **MY\_PERMISSIONS\_REQUEST\_STORAGE\_ACCESS** is an integer constant that you need to declare first and assign an integer value to it.

- Created another override method to check the outcome provided by user for the permission request whether it is granted or not. if granted, calls doOnCreate() method again.

- That’s it, I hope this helps. This is the basic implementation, you can handle the rejection as you see fit. These information for granting storage access can be referred to in Android documentation for API 23+. Full Java file is also attached (UE V4.16) link text .

---

<div class="post-metadata">

**Author:** ![hossam.ahamid](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@hossam.ahamid](https://forums.unrealengine.com/u/hossam.ahamid)\
**Post date:** [October 4, 2017, 11:31pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/10 "2017-10-04T23:31:50Z")

</div>

Please refer to my answer below.

---

<div class="post-metadata">

**Author:** ![iscaru1988](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@iscaru1988](https://forums.unrealengine.com/u/iscaru1988)\
**Post date:** [November 6, 2017, 11:54am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/11 "2017-11-06T11:54:52Z")

</div>

Oh thanks for this piece of wisdom!!!, Ill give it a try.

---

<div class="post-metadata">

**Author:** ![RasenSama](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RasenSama](https://forums.unrealengine.com/u/RasenSama)\
**Post date:** [March 26, 2018, 1:00pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/12 "2018-03-26T13:00:05Z")

</div>

I tried this and got “cannot find symbol” error during packaging referring to MY\_PERMISSIONS\_REQUEST\_STORAGE\_ACCESS  
does anyone know a solution for this?

---

<div class="post-metadata">

**Author:** ![LCDLV](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lcdlv/32/756912_2.png) [@LCDLV](https://forums.unrealengine.com/u/LCDLV)\
**Post date:** [July 31, 2018, 7:56pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/13 "2018-07-31T19:56:28Z")

</div>

Do you have an update for version 4.20? I’m having this issue and I try this solution, but I have errors on compiling.

---

<div class="post-metadata">

**Author:** ![Awicks](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Awicks](https://forums.unrealengine.com/u/Awicks)\
**Post date:** [August 30, 2018, 9:14pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/14 "2018-08-30T21:14:45Z")

</div>

Hey Hossam. I was hoping you could provide additional clarification for me in regards to you your code. I’m implemented it in my project. When I download the app the first time, my splash screen shows, and then the permission dialog shows. I answer “yes” to the permissions. However, since the splash screen is already displayed and I still receive the XAPK File Validation error. Any ideas or further instruction you can provide me with? Would really appreciate it!

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_9ce630c0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_9ce630c0](https://forums.unrealengine.com/u/anonymous_user_9ce630c0)\
**Post date:** [January 28, 2019, 7:02am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/15 "2019-01-28T07:02:17Z")

</div>

Can you tell me how to fix this issue for 4.21

---

<div class="post-metadata">

**Author:** ![FollowMyStaR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@FollowMyStaR](https://forums.unrealengine.com/u/FollowMyStaR)\
**Post date:** [February 12, 2019, 9:37am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/16 "2019-02-12T09:37:48Z")

</div>

Can you please update to downloanderactivity ue 4.21? thanks.

---

<div class="post-metadata">

**Author:** ![LCDLV](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lcdlv/32/756912_2.png) [@LCDLV](https://forums.unrealengine.com/u/LCDLV)\
**Post date:** [September 27, 2019, 12:21am UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/17 "2019-09-27T00:21:33Z")

</div>

I made a little change to avoid errors on compiling in 4.22. I don’t try this file yet!  
link text

---

<div class="post-metadata">

**Author:** ![Ixiguis](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Ixiguis](https://forums.unrealengine.com/u/Ixiguis)\
**Post date:** [August 22, 2020, 10:27pm UTC](https://forums.unrealengine.com/t/android-api-23-xapk-validation-failed-due-to-obb-permissions/398212/18 "2020-08-22T22:27:15Z")

</div>

Unfortunately this didn’t solve the issue for me. If anyone has another suggestion, please share.
