aws-amplify / amplify-swift

A declarative library for application development using cloud services.
Apache License 2.0
452 stars 196 forks source link

Build failed for arm64e: Amplify.swiftmodule is not built for arm64e #3893

Open CarlosJaimes opened 1 week ago

CarlosJaimes commented 1 week ago

Describe the bug

When trying to build my iOS application for arm64e, the build fails with the error message: Build failed because Amplify.swiftmodule is not built for arm64e. Please try a run destination with a different architecture.

I am following Apple's documentation for enabling Pointer Authentication (PAC) as per Apple's documentation. The error occurs after configuring the app to build with the arm64e architecture in Xcode and trying to archive the build.

The issue is preventing me from using security features provided by the arm64e architecture, and it seems that the current version of the Amplify framework is not compatible with this architecture.

Screenshot 2024-10-07 at 10 44 39 AM

Steps To Reproduce

1 - Follow Apple's instructions for enabling arm64e and Pointer Authentication (PAC) from Apple Documentation. (https://developer.apple.com/documentation/security/preparing-your-app-to-work-with-pointer-authentication) 

2 - In Xcode, go to Build Settings and add arm64e to the Architectures section under $(ARCHS_STANDARD) and the Excluded Architectures field should remain empty.

3 - Import AWS Amplify in your project:
import Amplify
import AWSAPIPlugin
import AWSCognitoAuthPlugin

4 - In the AppDelegate or SceneDelegate, initialize the AWS Amplify library:

func configureAmplify() {
    do {
        try Amplify.add(plugin: AWSCognitoAuthPlugin())
        try Amplify.add(plugin: AWSAPIPlugin())
        try Amplify.configure()
        print("Amplify configured successfully")
    } catch {
        print("Failed to configure Amplify: \(error)")
    }
}

5 - Build the app targeting arm64e architecture.
6 - The build will fail with the error: Amplify.swiftmodule is not built for arm64e.

Expected behavior

The application should build successfully for arm64e architecture without throwing errors. I expect AWS Amplify and its related modules to support the arm64e architecture to allow for Pointer Authentication (PAC) on newer devices.

Amplify Framework Version

2.42.1

Amplify Categories

API, DataStore

Dependency manager

Swift PM

Swift version

5.0

CLI version

12.12.6

Xcode version

16.0 (16A242d)

Relevant log output

Build failed because Amplify.swiftmodule is not built for arm64e. Please try a run destination with a different architecture.

Is this a regression?

Yes

Regression additional context

No response

Platforms

iOS

OS Version

17

Device

iPad Pro M4/ iPad Pro M2

Additional context

This issue prevents the app from building with arm64e, which is necessary to enable Pointer Authentication (PAC) as required for additional security on newer devices. We rely heavily on AWS Amplify for data synchronization, and this is a critical blocker for compliance with our security requirements.

thisisabhash commented 1 week ago

Hello, Thank you for posting this issue. Our team will take a look and post updates here.

CarlosJaimes commented 1 week ago

Thank you very much, I will be very attentive. That is a critical security point that my application must solve.