Android Library Project using Android Studio

后端 未结 6 2059
离开以前
离开以前 2021-01-31 16:12

This question might have been answered somewhere but couldn\'t find the appropriate one.

I want to know how can I create a common utility library project in Android Stud

6条回答
  •  后悔当初
    2021-01-31 16:55

    Your build.gradle should look something like this

    apply plugin: 'android-library'
    
    repositories {
        mavenCentral()
    } 
    dependencies {
    compile 'com.android.support:support-v4:18.0.0'
    }
    
    android {
    compileSdkVersion 18
    buildToolsVersion '18.1.1'
    
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            res.srcDirs = ['res']
        }
    }
    }
    

    Look at the first line

提交回复
热议问题