I added the Amplify package and now when I’m trying to initialize the predictions plugin is giving me an "’AWSPredictionsPlugin’ initializer is inaccessible due to ‘internal’ protection level" error. (I provisioned the backend resources prior to this too)
struct FrenchAppApp: App {
init(){
configureAmplify()
}
var body: some Scene { ...///
func configureAmplify() {
let apiPlugin = AWSAPIPlugin(modelRegistration: AmplifyModels())
let dataStorePlugin = AWSDataStorePlugin(modelRegistration: AmplifyModels())
let s3 = AWSS3StoragePlugin()
let cognitoAuth = AWSCognitoAuthPlugin()
let predictions = AWSPredictionsPlugin()
do {
try Amplify.add(plugin: apiPlugin)
try Amplify.add(plugin: dataStorePlugin)
try Amplify.add(plugin: s3)
try Amplify.add(plugin: cognitoAuth)
try Amplify.add(plugin: predictions)
try Amplify.configure()
print("Initialized Amplify");
} catch {
// simplified error handling
print("Could not initialize Amplify: \(error)")
}
}
I tried making the init public just for testing but it didn’t work, also tried this:
`class MyAWSPredictionsPlugin: AWSPredictionsPlugin {
override init() {
super.init()
}
}`
and it didn’t work.
>Solution :
There was a ticket issue on the repository two weeks ago, and has been fixed in the PR #3009, and the first release with the fix is the 2.11.6 version (2023-06-07).
So you need to update your current version.