Google Instant app error

I used ‘ia’ command. (ia is for instant app launching)

and I got an error messages.

I used ‘Native/Project Template/App’ template. And I didn’t change anything.

06-26 17:19:20.093 19189-19201/? E/Isotope: UID: [10200] PID: [19189] MethodInvocationStub : Exception while calling method setUidCleartextNetworkPolicy java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at com.google.android.instantapps.supervisor.ipc.common.SandboxEnforcer.enforceUnsupportedPolicy(PG:1) at com.google.android.instantapps.supervisor.ipc.common.SandboxEnforcer.enforceUnsupportedMethodPolicy(PG:4) at com.google.android.instantapps.supervisor.ipc.ProxyMethodHandler.handleMethod(PG:3) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationStub.onTransact(PG:21) at android.os.Binder.execTransact(Binder.java:573) 06-26 17:19:20.094 19268-19268/? E/Isotope: UID: [99013] PID: [19268] MethodInvocationProxy : Exception while calling method public abstract void android.os.INetworkManagementService.setUidCleartextNetworkPolicy(int,int) throws android.os.RemoteException java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.readReply(PG:2) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.invoke(PG:17) at java.lang.reflect.Proxy.invoke(Proxy.java:813) at $Proxy12.setUidCleartextNetworkPolicy(Unknown Source) at android.os.StrictMode.setVmPolicy(StrictMode.java:1693) at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:185) at android.app.Activity.performCreate(Activity.java:6955) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) 06-26 17:19:20.095 19268-19268/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.mycompany.app, PID: 19268 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.app/com.ansca.corona.CoronaActivity}: java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) Caused by: java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.readReply(PG:2) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.invoke(PG:17) at java.lang.reflect.Proxy.invoke(Proxy.java:813) at $Proxy12.setUidCleartextNetworkPolicy(Unknown Source) at android.os.StrictMode.setVmPolicy(StrictMode.java:1693) at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:185) at android.app.Activity.performCreate(Activity.java:6955) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)  at android.app.ActivityThread.-wrap14(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6776)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)  06-26 17:19:20.098 19189-19299/? E/Isotope: UID: [10200] PID: [19189] IActivityManagerProxy : Instant app: com.mycompany.app crashed: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mycompany.app/com.ansca.corona.CoronaActivity}: java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2984) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045) at android.app.ActivityThread.-wrap14(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6776) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410) Caused by: java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]-\>void not available to instant apps at android.os.Parcel.readException(Parcel.java:1693) at android.os.Parcel.readException(Parcel.java:1646) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.readReply(PG:2) at com.google.android.instantapps.supervisor.ipc.base.MethodInvocationProxy.invoke(PG:17) at java.lang.reflect.Proxy.invoke(Proxy.java:813) at $Proxy12.setUidCleartextNetworkPolicy(Unknown Source) at android.os.StrictMode.setVmPolicy(StrictMode.java:1693) at com.ansca.corona.CoronaActivity.onCreate(CoronaActivity.java:185) at android.app.Activity.performCreate(Activity.java:6955) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1126) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2927) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3045)  at android.app.ActivityThread.-wrap14(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1642)  at android.os.Handler.dispatchMessage(Handler.java:102)  at android.os.Looper.loop(Looper.java:154)  at android.app.ActivityThread.main(ActivityThread.java:6776)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)  06-26 17:19:20.132 19189-19189/? E/Isotope: UID: [10200] PID: [19189] IsolatedConnection : Isolated service: 'ComponentInfo{com.google.android.instantapps.supervisor/com.google.android.instantapps.supervisor.isolatedservice.IsolatedService15}' abnormally disconnected.

Hello,

I am currnetly dealing with the same problem. Did you ever get it working and what was the solution? Any help would be greatly appreciated!

I’m not sure I follow. Can you specify how do you call the “ia” command?

Everything seems to work fine for me:

  1. Copy Native/Project Template/App to ~/test

  2. Start Android Studio

  3. Drag & Drop ~/test/android on Android Studio icon in the Dock

  4. Select File -> Sync Project With Cradle Files

  5. Press :arrow_forward:in Android Studio

After this project successfully starts on the device. If it doesn’t try Selecting Build -> Clean Project and repeat steps 3-5.

Also, what platform are you doing it on?

I can probably shed some light on this - he means Google’s Instant App development SDK, which features a tool for transferring apks/zips to device and running them as Instant apps would run from the Play Store. It should be noted that this is the only way to reproduce this error and correctly test instant apps without uploading them to Play Store.

Just doing a regular apk transfer will NOT make them run in the Instant App sandbox, but just as a regular app - in which case everything works fine, and this error wont appear. I can however confirm that uploading an instant app to the Play Store and officially releasing them there DOES produce this error, and immediately crashes the app (learned that the hard way…).

So to test this locally, you need the “ia” command line tool. You can install it from the package manager, and then zip your apk and run it on device. More info on its use can be found here: https://github.com/googlesamples/android-instant-apps/blob/master/urlless/README.md

As a general note on this problem, it seems to me that “java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]->void not available to instant apps” is the culprit - that Corona automatically tries to run “setUidCleartextNetworkPolicy”, which it is not allowed to in the Instant app sandbox. Personally I have yet to find a way around this. I have compiled completely empty projects, and removed all permissions in the Android Manifest, and this error still happens. It definitely appears to part of the core Corona initialization, which we cannot really access.

Anybody with any ideas on how to get around it?

That’s great post.

Corona native and CoronaCards don’t support Google Instant Apps.

I’m just waiting to support of Coronalabs… )-:

Hello,

I am currnetly dealing with the same problem. Did you ever get it working and what was the solution? Any help would be greatly appreciated!

I’m not sure I follow. Can you specify how do you call the “ia” command?

Everything seems to work fine for me:

  1. Copy Native/Project Template/App to ~/test

  2. Start Android Studio

  3. Drag & Drop ~/test/android on Android Studio icon in the Dock

  4. Select File -> Sync Project With Cradle Files

  5. Press :arrow_forward:in Android Studio

After this project successfully starts on the device. If it doesn’t try Selecting Build -> Clean Project and repeat steps 3-5.

Also, what platform are you doing it on?

I can probably shed some light on this - he means Google’s Instant App development SDK, which features a tool for transferring apks/zips to device and running them as Instant apps would run from the Play Store. It should be noted that this is the only way to reproduce this error and correctly test instant apps without uploading them to Play Store.

Just doing a regular apk transfer will NOT make them run in the Instant App sandbox, but just as a regular app - in which case everything works fine, and this error wont appear. I can however confirm that uploading an instant app to the Play Store and officially releasing them there DOES produce this error, and immediately crashes the app (learned that the hard way…).

So to test this locally, you need the “ia” command line tool. You can install it from the package manager, and then zip your apk and run it on device. More info on its use can be found here: https://github.com/googlesamples/android-instant-apps/blob/master/urlless/README.md

As a general note on this problem, it seems to me that “java.lang.SecurityException: Method class android.os.INetworkManagementService$Stub$Proxy.setUidCleartextNetworkPolicy[int, int]->void not available to instant apps” is the culprit - that Corona automatically tries to run “setUidCleartextNetworkPolicy”, which it is not allowed to in the Instant app sandbox. Personally I have yet to find a way around this. I have compiled completely empty projects, and removed all permissions in the Android Manifest, and this error still happens. It definitely appears to part of the core Corona initialization, which we cannot really access.

Anybody with any ideas on how to get around it?

That’s great post.

Corona native and CoronaCards don’t support Google Instant Apps.

I’m just waiting to support of Coronalabs… )-: