-
开发环境:
Android Studio Dolphin | 2021.3.1 Patch 1
gradle-7.4
gradle tool 7.3.1
-
build.grade
plugins {
id 'com.android.application'
}
android {
namespace 'com.gangzi.starttest'
compileSdk 32
defaultConfig {
applicationId "com.example.starttest"
minSdk 16
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
sourceSets.main {
jniLibs.srcDir 'libs'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.4.1'
}
-
项目目录结构
![](https://i-blog.csdnimg.cn/blog_migrate/35e6056b61fc835e5ea823b4f25b24f4.png)
-
重点:
-
gradle配置
sourceSets.main {
jniLibs.srcDir 'libs'
}
-
目录结构
不能将so直接放入libs文件夹,需要对应的架构文件夹,否则无效
例如armeabi