Android Studio中匯入aar依賴時,需要修改的檔案
需要在build.gradle檔案中新增如下紅色部分
apply plugin: 'com.android.application' android { compileSdkVersion 27 defaultConfig { applicationId "exrobot.lulyfan.ut.com.rosdemo" minSdkVersion 15 targetSdkVersion 27 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"} buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } repositories { flatDir { dirs 'libs' } } dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation 'com.android.support.constraint:constraint-layout:1.1.2'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' implementation(name: 'android_10-0.2.0', ext: 'aar')-》其中name是匯入架包的名稱,ext是架包的字尾名 }