jmarina
jmarina

Reputation: 375

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'

various things result in this error, so I thought an answer to point this out would be useful, because the existing answers for this error were not helpful in my case

Upvotes: 2

Views: 12870

Answers (1)

jmarina
jmarina

Reputation: 375

problem

org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':app'.

how to diagnose (in android studio 3.2.1)

click on Build tab on bottom toolbar click on Build tab (next to Sync tab) at the top of the panel that appears

you will see this:

* What went wrong:
A problem occurred configuring project ':app'.
> More details/hints about your problem here.

also add compile flags: go to File->Settings... -> Build,Execution,Deployment -> Compiler -> Command-line Options: --stacktrace --info

click apply, ok

how to fix

in my case, it could not find the ndk, so I defined the environment variables

ANDROID_NDK
ANDROID_NDK_HOME
ANDROID_NDK_ROOT

all pointing to

d:\android\android-ndk-r18b

(the root of the ndk where it unzipped)

then, restart android studio (to see the new environment variables) reload the project

File->Project Structure set Android NDK location to same path as above, click OK

File->Sync Project with Gradle Files (or click Sync Project with Gradle Files icon in top toolbar)

now build and run work

if run is not available, need to Edit Configurations... in the dropdown next to the build hammer in android studio; do another sync as shown above, then build and run work

Upvotes: 2

Related Questions