last day (15 days later) » 

3:35 AM
0
Q: Gradle sync failed: A problm occurred configuring project ':app'

The Unholy Metal MachineI'm starting to learn Kotlin (I never used android studio before), when I try to run the app, I got this error : Gradle sync failed: A problem occurred configuring project ':app'. I have no idea how to fix it. I tried that : https://stackoverflow.com/a/43908862/2430299 but that didn't help. ...

 
can you also post your gradle build file for your app ?
 
@Jimmy do you mean build.gradle ?
@pablobu the gradle console is blank
 
yes. @pablobu his stacktrace is in idea.log that he attached on top. it is a link
there should be another build.gradle inside your app folder. Can you post that?
 
@Jimmy app/build.gradle added
 
are you actually using C++ as well?
 
3:35 AM
@Jimmy I have to wrap c++ code, but I haven't any c++ code yet. I also try to build another project with Kotlin only, I got the exact same problem.
 
When you do build, in your message window, do you see any instructions ? Like Install NDK and sync Project ?
 
I got some messages like this, and I let android studio installed all of them. But I have to say that some failed one or two times before I got them installed
 
Are you able to create simple android project and run ?
no kotlin or no c++
 
yep
I mean I can, but I didn't try it
 
Can you try once and see ? Just to verify that your gradle environment is fine
and what version of studio are you using ?
 
3:47 AM
ok
android studio version 3.0
 
and when you try new project with kotlin only support but not c++, it is still failing?
when it fails there should be some message in Message window. what does it say?
 
I did a test with a project without kotlin neither c++ : you can get the video of my desktop here : framadrop.org/r/…
I did a test with kotlin and without c++ before posting on stack, I got the same problem I have with kotlin and c++
 
What does the message windows say?
I never created kotlin project, just tried once and it works fine for me .
 
4:02 AM
/home/user/AndroidStudioProjects/TEST/app/build.gradle
Error:Error:Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
<a href="openFile:/home/user/AndroidStudioProjects/TEST/app/build.gradle">Open File</a><br><a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Could not resolve com.android.support:appcompat-v7:26.1.0.">Show Details</a>
Error:Error:Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.1.
oops
Jimmy are you on ubuntu 16.04 ?
because I have friend who told me he is able to build android projects on ubuntu 16.04 only, but it should work on other linux
 
Nope, i am on windows
 
can you try to go to settings/gradle and disable offline work and try again
 
what do you mean by setting/gradle ?
 
in file/settings -- Build,Exuction,Deployment/Gradle
 
4:08 AM
ok, TEST is now a build succed after I disabled offline
I don't have set any virtual device, so I can't run it for now
I try to build a TEST-KOTLIN project same way than TEST
 
Ok, I am not quite sure about why this happened. I never worked in kotlin. So depenceny management in my case contains compile instead of implementation. So if not found it always resolves online. In your case , for some reason it is not able to resolve online
if it build successfully, you should be fine
alright, before you start , do the same thing that you did before. Invalidate cache and retart. You should be fine
good luck
 
@Jimmy thx! I appreciate your help
btw TESTKOTLIN build
 
4:29 AM
@TheUnholyMetalMachine NP. Glad I could help.
 

last day (15 days later) »