Here I wanted to give Quick fixes that i faced in work.
Issue 1
Faced below issue when run a gradlew command in Android Studio Terminal.
projectpath> gradlew assembleRelease
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
gradlew : The term 'gradlew' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ gradlew assembleRelease
+ ~~~~~~~
+ CategoryInfo : ObjectNotFound: (gradlew:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Solution
To Solve this issue, You need to run below command.
./gradlew assembleRelease
Issue 2
2 files found with path 'META-INF/DEPENDENCIES'.
Adding a packagingOptions block may help, please refer to
https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
for more information
Solution
To resolve this issue, you need to add below code in project level gradle file i.e. app/build.gradle file
android{
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
}
}
Issue 3
* What went wrong:
Execution failed for task ':app:packageRelease'.
> A failure occurred while executing com.android.build.gradle.tasks.PackageAndroidArtifact$IncrementalSplitterRunnable
> com.android.ide.common.signing.KeytoolException: Failed to read key AndroidDebugKey from store "C:\Users\Praveenb\.android\debug.keystore": Invalid keystore format
Solution
To resolve this issue,
deleted .android folder in C:/Users/<user>/ folder. Solved the issue.
It may not allow to delete .android folder even when exit Android Studio. You may need to restart PC, to be able to delete .android folder.
Hope it helps somebody ๐