We have been using reflection to enable the wifi hotspot in Android with our app (as everybody else, as it seems):
WifiManager mWifiManager = (WifiManager) this.context.getSystemService(Context.WIFI_SERVICE);
Method method = mWifiManager.getClass().getMethod("setWifiApEnabled", WifiConfiguration.class, boolean.class);
method.invoke(mWifiManager, wifiConfig, enabled);
Since Android 7.1 this is not working any more. Although it starts the hotspot (I see the hotspot icon in the info bar), the connecting client can't use the internet connection of the phone.
With Oreo (Android 8.0) the situation is getting worse as it does not do anything at all.
I found this solution for a local-only-hotspot: How to turn on/off wifi hotspot programatically in Android 8.0 (Oreo) But we need to share the internet connection, so we can't use this one.
Also having root access to the phone is no solution for us.
Did we miss any official or unofficial way to achieve our goal or is there really no way of doing this any more since Android 7.1?