1. Download our Official Android App: Forums for Android!

have Android Studio 3.1.1 configuration problem

Discussion in 'Android Development' started by Learn Android, Mar 13, 2019.

  1. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    try to run HelloWorld at studio . encounter a lot of problems.

    long time ago, try to do the same thing in Eclipse . no problem at all. why Android Studio try to scare people away??

    I have Android Studio 3.1.1 install when I try to run my first Android app . I got the following error messge

    1) Failed to find Build Tools revision 27.0.3.

    but my build gradle is

    ndroid {
    compileSdkVersion 28
    defaultConfig {
    applicationId "com.example.mslutry.myapplication"
    minSdkVersion 26
    targetSdkVersion 28
    versionCode 1
    versionName "1.0"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    }
    }
    2) Module not specified
     

    Advertisement

  2. LV426

    LV426 I say we take off and nuke this place from orbit
    Moderator
    Rank:
     #10
    Points:
    1,988
    Posts:
    8,537
    Joined:
    Oct 16, 2015

    Oct 16, 2015
    8,537
    12,706
    1,988
    Male
    Software developer
    South West of England
    I'd recommend upgrading to the latest version of Android Studio, which is 3.3

    (moved thread to development forum)
     
    GameTheory and Unforgiven like this.
  3. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    I once has 3.3 , but I am unable to solve the dependencies problem. I get error on the following part . I Google and found a lot of people said they have this problem , but no of the solution is work for me

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    }
     
  4. GameTheory

    GameTheory Android Expert
    Rank:
     #46
    Points:
    493
    Posts:
    3,751
    Joined:
    Jul 23, 2012

    So now that you have android studio 3.3 installed, what does the error say? Can you post the error?

    Also this is what build.gradle looks like in a newly created project in AS 3.3:
    Code (Text):
    1. apply plugin: 'com.android.application'
    2.  
    3. android {
    4.     compileSdkVersion 28
    5.     defaultConfig {
    6.         applicationId "com.gt.helloworld"
    7.         minSdkVersion 15
    8.         targetSdkVersion 28
    9.         versionCode 1
    10.         versionName "1.0"
    11.         testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    12.     }
    13.     buildTypes {
    14.         release {
    15.             minifyEnabled false
    16.             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    17.         }
    18.     }
    19. }
    20.  
    21. dependencies {
    22.     implementation fileTree(dir: 'libs', include: ['*.jar'])
    23.     implementation 'com.android.support:appcompat-v7:28.0.0'
    24.     implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    25.     testImplementation 'junit:junit:4.12'
    26.     androidTestImplementation 'com.android.support.test:runner:1.0.2'
    27.     androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    28. }
     
  5. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    Unresolved dependencies at app/build.gradle the detail message shown as: there are totally 9 error message.

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:28.0.0.
    <a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Could not resolve com.android.support:appcompat-v7:28.0.0.">Show Details</a>
    Affected Modules: <a href="openFile:C:/Android/Project/HelloWorld/app/build.gradle">app</a>

    Unable to resolve dependency for ':app@debug/compileClasspath': Could not resolve com.android.support.constraint:constraint-layout:1.1.3.
    <a href="Unable to resolve dependency for &#39;:app@debug/compileClasspath&#39;: Could not resolve com.android.support.constraint:constraint-layout:1.1.3.">Show Details</a>
    Affected Modules: <a href="openFile:C:/Android/Project/HelloWorld/app/build.gradle">app</a>

    Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve com.android.support.test:runner:1.0.2.
    <a href="Unable to resolve dependency for &#39;:app@debugAndroidTest/compileClasspath&#39;: Could not resolve com.android.support.test:runner:1.0.2.">Show Details</a>
    Affected Modules: <a href="openFile:C:/Android/Project/HelloWorld/app/build.gradle">app</a>

    Unable to resolve dependency for ':app@debugUnitTest/compileClasspath': Could not resolve junit:junit:4.12.
    <a href="Unable to resolve dependency for &#39;:app@debugUnitTest/compileClasspath&#39;: Could not resolve junit:junit:4.12.">Show Details</a>
    Affected Modules: <a href="openFile:C:/Android/Project/HelloWorld/app/build.gradle">app</a>
     
  6. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    my gradle-wrapper.properties
    distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip

    buildTypes {
    release {
    minifyEnabled false
    proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
    }
    }
     
  7. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    I also noticed if I common the following I did not have Gradle sync problem
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    implementation 'com.android.support:design:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

    if I am unable to get those jar online , can I download and put in where? how my Gradle build need to change?
     
  8. GameTheory

    GameTheory Android Expert
    Rank:
     #46
    Points:
    493
    Posts:
    3,751
    Joined:
    Jul 23, 2012

    Once you open your project in AS allow it to finish loading. Then on the AS tool bar click on the button labeled "Sync Project with Gradle Files". This usually solves the dependency issues. If it doesn't let us know.

    I've noticed that windows users are having some issues with AS that linux and mac users don't seem to be having.
     
  9. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    Thanks for the reply!
    but the dependency issues happen when "Sync Project with Gradle Files".

    I using Win 7 , it is possible to let me past the curve t stat my journey at app program??
     
  10. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    Is anyone can told me
    if I am unable to get those jar online , can I download and put in where? how my Gradle build need to change?
     
  11. GameTheory

    GameTheory Android Expert
    Rank:
     #46
    Points:
    493
    Posts:
    3,751
    Joined:
    Jul 23, 2012

    No, if android studio(AS) is not installing correctly then you need to completely remove it from windows and reinstall it.

    Here is a guide to completely remove it.
    https://stackoverflow.com/a/39953746

    And here is another thread where a user was having issues with his AS installation and simply removing it and then reinstalling it fixed it.
    https://androidforums.com/threads/c...in-android-studio.1296456/page-2#post-7857984

    We can spend a bunch of time trouble shooting, but if your installation of AS is botched, then nothing will work.
     
    Learn Android likes this.
  12. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    Thanks for the reply ! actually I try to remove before , I do all other steps, but I did not do the step 3 before . I will try it again !
    for the install studio , I sample click next and next .
    do you have a recommend step by step install guide ?

    by the way does my download has a problem ?
    android-studio-ide-182.5264788-windows.exe


    *****************************************
    Step 1: Run the Android Studio uninstaller

    The first step is to run the uninstaller. Open the Control Panel and under Programs, select Uninstall a Program. After that, click on "Android Studio" and press Uninstall. If you have multiple versions, uninstall them as well.

    Step 2: Remove the Android Studio files

    To delete any remains of Android Studio setting files, in File Explorer, go to your user folder (%USERPROFILE%), and delete .android, .AndroidStudio and any analogous directories with versions on the end, i.e. .AndroidStudio1.2, as well as .gradle and .m2 if they exist.

    Then go to %APPDATA% and delete the JetBrains directory.

    Finally, go to C:\Program Files and delete the Android directory.

    Step 3: Remove SDK

    To delete any remains of the SDK, go to %LOCALAPPDATA% and delete the Android directory.

    Step 4: Delete Android Studio projects
     
  13. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    %APPDATA% in没有 Win7 is point to
    C:\Users\mylogin account\AppData\Roaming
    could not find JetBrains
     
  14. GameTheory

    GameTheory Android Expert
    Rank:
     #46
    Points:
    493
    Posts:
    3,751
    Joined:
    Jul 23, 2012

    The best tutorial to follow would be in the following link which includes both a written and video tutorial for the supported operating systems.
    https://developer.android.com/studio/install

    I don't use Windows so I cannot assist with any windows troubleshooting.
     
  15. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    Hi Thanks for the reply !

    I following your suggestions to remove Android Studio and reinstall it again. I still have the following error message
     
  16. Learn Android

    Learn Android Newbie
    Thread Starter
    Rank:
     #798
    Points:
    16
    Posts:
    15
    Joined:
    Mar 13, 2019

    Mar 13, 2019
    15
    1
    16
    just want you know , after setting proxy the problem is gone.

    thanks for all the replies .
     
    GameTheory likes this.

Share This Page

Loading...