#✅ - Could not get unknown property 'android' for project ':amplify_secure_storage'

29 messages · Page 1 of 1 (latest)

limpid orbit
#

I am developing Flutter project and while building it for android I had the following error:
`* What went wrong:
A problem occurred configuring project ':amplify_secure_storage'.

Failed to notify project evaluation listener.
Could not get unknown property 'android' for project ':amplify_secure_storage' of type org.gradle.api.Project.
Could not get unknown property 'android' for project ':amplify_secure_storage' of type org.gradle.api.Project.`

Here is the version:
amplify_api: ^1.0.0 amplify_flutter: ^1.0.0 amplify_datastore: ^1.0.0-supports-only-mobile.0 amplify_auth_cognito: ^1.0.0 amplify_storage_s3: ^1.0.0 amplify_authenticator: ^1.0.0

app/build.gradle
minSdkVersion 24 targetSdkVersion 33

android/build.gradle
ext.kotlin_version = '1.7.10' ... dependencies { classpath 'com.android.tools.build:gradle:4.1.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" ... }

gradle-wrapper.properties:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

Flutter:
Flutter 3.7.10 • channel stable • Dart 2.19.6 • DevTools 2.20.1

I would appreciate any help, Thanks

neon smelt
#

Hi @limpid orbit 🙂 I believe this could be due to an outdated gradle dependency.

In android/build.gradle can you make the following update:

-classpath 'com.android.tools.build:gradle:4.1.3'
+classpath 'com.android.tools.build:gradle:7.4.2'

And in android/gradle/wrapper/gradle-wrapper.properties can you change the following?

-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
limpid orbit
#

Hi, @neon smelt , I updated the values and this is the new error:

  • Where:
    Build file '/Users/yasinaydin/projects/movini/android/app/build.gradle' line: 30

`* What went wrong:
A problem occurred evaluating project ':app'.

Failed to apply plugin 'com.android.internal.application'.
The option 'android.jetifier.blacklist' is deprecated.
It was removed in version 7.0 of the Android Gradle plugin.
This property has been replaced by android.jetifier.ignorelist
`

neon smelt
#

Can you share that file (android/app/build.gradle)?

limpid orbit
neon smelt
#

Can you try the following:

flutter upgrade
flutter clean
cd android && ./gradlew clean && cd ..

And try the build again?

#

Can you also ensure that android.jetifier.blacklist is updated to android.jetifier.ignorelist in your android/gradle.properties file if present?

limpid orbit
# neon smelt Can you also ensure that `android.jetifier.blacklist` is updated to `android.jet...

It successfully build after changing this but while trying to run it on a simulator I had a new error:

`FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugKotlin'.

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
Compilation error. See log for more details`

neon smelt
#

Hmm that would seem to suggest an issue with Kotlin code... Can you provide more of the error logs? I might also suggest opening the android folder in Android Studio and trying to run the app there, as that may provide more information about where the error is occurring.

limpid orbit
#

This is the output with stacktrace. (I excluded warnings before this error)

neon smelt
#

There seems to be an error in MainActivity.kt with the DebugAppCheckProviderFactory class

#

I would double check your Firebase dependencies are up-to-date and check the import path of DebugAppCheckProviderFactory in MainActivity.kt

limpid orbit
#

Okay, will do that now.

limpid orbit
#

I solved last issue! It was related to AppCheck. In path: android/app/src/main/kotlin/com/project_name/project_name
There is the MainActivity.kt and in that I had this code without comments. Once I commented out these the problem was solved (I did remove appcheck from the app but forgot to remove these). So, the last error wasn't about versioning or amplify.
After running it on android simulator unfortunately I got another error. (Error in attached file)

#

These seems correct according to the documentation.

neon smelt
#

Yes, those changes are needed in newer Android versions to be able to query the installed browsers.

#

Is everything working as expected now?

limpid orbit
#

I have the error in the last message I sent (message.txt). I had those configured before getting this error.

neon smelt
#

Oh I misread that. Is there a browser installed on the device you're trying to run the app?

#

Can you send your AndroidManifest.xml file?

limpid orbit
#

No, I didn't install. Do users have to install browser for this? (Its Pixel 2 API 28 simulator.)

limpid orbit
#

I downloaded Opera and Firefox to solve the issues and still there is an error. (For some reason chrome is not working)

neon smelt
#

You may need to download an emulator with Google Play APIs installed. This will more closely match a real device and provides Google Chrome out of the box. I would create a new emulator, one with the Play Store button, then choose an image that has Google Play APIs. For example a Pixel 4 with API Level 33 (Tiramisu).

limpid orbit
#

Okay, will let you know when I try.

limpid orbit
#

It works! Thank you for helping 🙏

neon smelt
#

🎉

#

Anytime 🙂

toxic pelicanBOT
#

✅ - Could not get unknown property 'android' for project ':amplify_secure_storage'

#

Marked as solved.