Android Studio update today with regression

Android Studio will start today, and an update notification has appeared. Since I really want to learn new features and bug fixes, I clicked the "Yes" button. Now the dialog box "Project Structure", in which you install the dependencies, is missing and replaced by a message:

We will provide a user interface to configure project settings later. Until then, please manually edit the build.gradle (s.) File

So, I go out to try to figure out how to add an ActionBarSherlock to my project as a project dependency, and hit a brick wall. I do not know how to import an ActionBarSherlock project as a library project and configure my project to use it. The documentation documentation on Google, IntelliJ, and Gradle docs are scarce, so you have a lot of information about existing build systems.

+4
source share
1 answer

There are many posts on SO how to do this (although mentioned with the already missing project structure dialog box)

How to add a library project in Android Studio?

Android-Studio ActionBar lock error with gradle

Install ActionbarSherlock with Android Studio?

Problems importing a project into Android Studio regarding ActionBarSherlock

In short:

  • Create a folder (i.e. / libraries) in your root.
  • Extract actionbarsherlock there
  • Create a new build.gradle file in the actionbarsherlock root with the following contents

      buildscript {
         repositories {
             maven {url 'http://repo1.maven.org/maven2'}
         }
         dependencies {
             classpath 'com.android.tools.build:gradleogle. 4'
         }
     }
     apply plugin: 'android-library'
    
     dependencies {
         compile files ('libs / android-support-v4.jar')
     }
    
     android {
         compileSdkVersion 17
         buildToolsVersion "17.0.0"
    
    
    defaultConfig { minSdkVersion 7 targetSdkVersion 16 } sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = ['src'] resources.srcDirs = ['src'] res.srcDirs = ['res'] } } 
    }
  • In the build.gradle project

      dependencies {
         // NOTE that "libraries" is actually a folder name you created in step 1
         compile project (": libraries: actionbarsherlock")
         // Any other dependencies here
         // Make sure there is no android-support-v4.jar in this build file
         // as it is already contained in actionbarsherlock project
     }
    
  • In the settings .gradle
      // NOTE that "libraries" is actually a folder name you created in step 1
     include ': libraries: actionbarsherlock', ': <Your project name>'
    

EDIT

Last step: Close the project and open it again for Studio to get Intelli-sense data

+4
source

Source: https://habr.com/ru/post/1483245/


All Articles