Bare workflow not reading AndroidManifest.xml permissions

Hello,

I’m building an android app that uses InAppPurchases. I built it in expo and then ejected to bare workflow.

I have already added the required permission to the AndroidManifest.xml ().

However, when I compile my app bundle in visual studio using “expo build:android”, the Playstore will then give me an error when I upload the app and try to configure the purchases, saying “you need to add the BILLING permission to your APK”.

This tells me the compiler is only taking into account the permissions specified in app.json but I can’t add the billing permission to app.json because it’s not supported.


I have tried to compile my bundle via the android studio compiler and that does fix the permissions issue on the Playstore but I then get other compilation errors that I don’t get with the “expo build:android” compilation method, including one annoying error “cannot find symbol return BuildConfig.DEBUG;” on the MainAppilcation.java file. I looked everywhere and tried everything but this error seems to be unfixable.

So to recap:

  • If I build my android app bundle via “expo build:android”, I get no errors but Playstore doesn’t read the IAP permission on the AndroidManifest.xml.

  • If, on the other hand, I build my bundle via Generate Signed Bundle on the Android Studio, Playstore does read the (billing) permissions from the AndroidManifest.xml but my app won’t work because of the BuildConfig error.

My question is, is there a way to add the billing permissions to app.json or make sure the expo build takes into account the permissions on AndroidManifest.xml?

This is my AndroidManifest.xml code:

<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.myapp.app1">
  <uses-permission android:name="com.android.vending.BILLING" />
  <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"  />
  <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" tools:node="remove" />
  <uses-permission android:name="android.permission.READ_PHONE_STATE"  />
  <uses-permission android:name="android.permission.USE_FINGERPRINT"  />
  <uses-permission android:name="android.permission.VIBRATE" />
  <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
  <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" tools:node="remove"  />
  <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" tools:node="remove"  />
  <uses-permission android:name="android.permission.CAMERA"  tools:node="remove" />
  <uses-permission android:name="android.permission.READ_CONTACTS" tools:node="remove" />
  <uses-permission android:name="android.permission.READ_CALENDAR"  />
  <uses-permission android:name="android.permission.WRITE_CALENDAR"   />
  <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"  />
  <uses-permission android:name="android.permission.RECORD_AUDIO" tools:node="remove"  />
  <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"  />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"  />
  <uses-permission android:name="android.permission.WAKE_LOCK"  />
  <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
  <application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
    <meta-data android:name="expo.modules.updates.EXPO_UPDATE_URL" android:value="https://exp.host/@mag1cp0t/app1" />
    <meta-data android:name="expo.modules.updates.EXPO_SDK_VERSION" android:value="38.0.0" />
    <meta-data android:name="expo.modules.updates.ENABLED" android:value="true"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_CHECK_ON_LAUNCH" android:value="ALWAYS"/>
    <meta-data android:name="expo.modules.updates.EXPO_UPDATES_LAUNCH_WAIT_MS" android:value="0"/>
    <meta-data android:name="expo.modules.updates.EXPO_RELEASE_CHANNEL" android:value="default" />

  <activity
    android:name=".MainActivity" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:screenOrientation="portrait">
      <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
      </intent-filter>
    </activity>
    <activity android:name="com.facebook.react.devsupport.DevSettingsActivity"/>
  </application>
</manifest>

anyone?

Hi

That is because expo build:android is using the Expo build service that is only supported for the Managed workflow. So you seem to be mixing up the Bare workflow with the Managed workflow.

As it says here:

In the bare workflow the developer has complete control, along with the complexity that comes with that. You can use most APIs in the Expo SDK, but the build service and easy Configuration with app.json / app.config.js are not yet supported.

You will need to build with Android Studio. So the problem is not that the Bare workflow is not reading your AndroidManifest.xml. It’s that when using expo build:android you are effectively trying to use the Managed workflow.

I think it would be best for you to post another question about your problems building with Adroid Studio because that seems to be the actual problem here.