调用已经存在的lib

runwu2204 Lv6

gradle

image-20241121130857944

只需要在build.gradle

image-20241121130816022

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
plugins {
id 'com.android.application'
}

android {
namespace 'com.example.challengemobile'
compileSdk 33

defaultConfig {
applicationId "com.example.challengemobile"
minSdk 28
targetSdk 33
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
sourceSets {
main {//只需要寫入這個即可
jniLibs.srcDirs = ['libs']
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
ndkVersion '21.3.6528147'

}

dependencies {

implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}
  • 标题: 调用已经存在的lib
  • 作者: runwu2204
  • 创建于 : 2024-06-11 00:55:50
  • 更新于 : 2024-11-21 13:09:00
  • 链接: https://runwu2204.github.io/2024/06/11/开发/安卓开发/调用已经存在的lib/
  • 版权声明: 本文章采用 CC BY-NC-SA 4.0 进行许可。
评论
目录
调用已经存在的lib