Dana
2025-12-01 faf9ab5bc6f172819dd5c0cd6dcc0ebb82391c1e
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
47
48
49
50
51
52
53
54
55
56
57
apply plugin: 'com.android.library'
 
android {
    compileSdkVersion 27
 
 
 
    defaultConfig {
        namespace("com.anyun.libusbcamera")
        minSdkVersion 21
        targetSdkVersion 26
 
        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
 
        externalNativeBuild {
            cmake {
                arguments "-DANDROID_ARM_NEON=TRUE","-DANDROID_STL=c++_shared"
                cppFlags ""
            }
        }
        ndk {
            // Specifies the ABI configurations of your native
            // libraries Gradle should build and package with your APK.
            abiFilters  "arm64-v8a","armeabi-v7a"
        }
    }
 
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
 
    packagingOptions {
        // pickFirsts:当出现重复文件,会使用第一个匹配的文件打包进入apk
        pickFirst 'lib/armeabi-v7a/libjpeg.so'
        pickFirst 'lib/armeabi-v7a/libturbojpeg.so'
        pickFirst 'lib/arm64-v8a/libjpeg.so'
        pickFirst 'lib/arm64-v8a/libturbojpeg.so'
        pickFirst 'lib/*/libc++_shared.so'
 
    }
 
}
 
dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0'
}