AMDeviceSecureInstallApplicationBundle Start iOS from AndroidStudio

Reason: AMDeviceSecureInstallApplicationBundle failed with err = -402653177(The argument is invalid.)

Any idea? When I start from Xcode, everything works!!

This issue seems familiar: https://youtrack.jetbrains.com/issue/KT-41530. Most probably this is about your developer ID being not trusted on the device.

yes thx, as far as I see there is no solution?

The solution is to open the device’s Settings → General → Profiles and push the Trust button. The same way it should be done for an ordinary Xcode project, see this SO question for example. If you’re asking about the issue, I would say that there is no UX improvement there yet. Frendlier message should help here a lot. However, I’m not sure such thing can be done from the IDE, it is about the particular device’s security.

Thx Artyom for helping, but does not help.

The profile was not there, though I can install it via xCode, so I installed the certificate myself. But still same error.

Sorry, but I’m confused a bit. In your case, installing the app using Xcode works with no errors(no need to trust the developer), but the same app being run from Android Studio fails, and even this Profiles menu is inaccessible?

Yes. No Menü, but same App with XCode starts!! But not with AS

I have the same issue. Android Studio 4.2 build fails with

com.jetbrains.cidr.execution.debugger.backend.DebuggerFatalException: failed transferring /Users/tonis/workspace/kmm/ti-counter/build/ios/Debug-iphoneos/DIKit.app. Reason: AMDeviceSecureInstallApplicationBundle failed with err = -402653177(The argument is invalid.)

XCode build works. I have the DIKit dependency added with cocoaPods to the xcode project separately. Not in KMM build.gradle
plugin: 0.2.2(202-1.4.31-release-IJ)-93

EDIT:
Maybe Cocoapods created new targets to the Android Studio project, to each of my dependendencies. It turned out in the configuration, DIKit was selected as the target, not the iosApp.

1 Like

Is there any solution to this?