Permissions.askAsync not resolving on Android standalone app


I have a problem where Permissions.askAsync(...) is not resolving for my standalone Android app (note: its a detached ExpoKit app). I have implemented PermissionAwareActivity methods inside but for some reason it does not resolve and just waits forever.

package host.exp.exponent;

import android.os.Bundle;
import android.annotation.TargetApi;
import android.os.Build;

import com.facebook.react.ReactPackage;
import com.facebook.react.modules.core.PermissionAwareActivity;
import com.facebook.react.modules.core.PermissionListener;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import host.exp.exponent.generated.DetachBuildConstants;
import host.exp.exponent.experience.DetachActivity;


public class MainActivity extends DetachActivity implements PermissionAwareActivity {

  @Nullable private PermissionListener mPermissionListener;

  public String publishedUrl() {
    return "exp://";

  public String developmentUrl() {
    return DetachBuildConstants.DEVELOPMENT_URL;

  public List<String> sdkVersions() {
    return new ArrayList<>(Arrays.asList("26.0.0"));

  public List<ReactPackage> reactPackages() {
    return ((MainApplication) getApplication()).getPackages();

  public boolean isDebug() {
    return BuildConfig.DEBUG;

  public Bundle initialProps(Bundle expBundle) {
    // Add extra initialProps here
    return expBundle;

  protected void onCreate(Bundle savedInstanceState) {
    Fabric.with(this, new Crashlytics(), new Answers());

  // Allow using PermissionsAndroid in react-native-background-location library
  // Didn't work with Expo. See
  // Copied solution from
  public void requestPermissions(String[] permissions, int requestCode, PermissionListener listener) {
    mPermissionListener = listener;
    requestPermissions(permissions, requestCode);

  public void onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults) {
      if (mPermissionListener != null && mPermissionListener.onRequestPermissionsResult(requestCode, permissions, grantResults)) {
          mPermissionListener = null;

My JS:

 const camera = await Permissions.askAsync(Permissions.CAMERA);
const audio = await Permissions.askAsync(Permissions.AUDIO_RECORDING);

It never gets to console.log("test2"). And what is also interesting is that requestPermissions never gets called in

Hi @darkwata - could you explain what you’re trying to achieve by implementing PermissionAwareActivity inside of your If you take that out, do the calls to await Permissions.askAsync(...) still hang?

Hi @esamelson based on the following Github issue you need to implment PermissionAwareActivity:

Hi @darkwata - that issue is quite old and likely outdated. Expo does permissions differently from vanilla react native and does not use PermissionAwareActivity. Could you explain what happens if you remove all references to PermissionAwareActivity in and try calling await Permissions.askAsync(...) then?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.