build.gradle 5.38 KB


def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
    localPropertiesFile.withReader('UTF-8') { reader ->
        localProperties.load(reader)
    }
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
    throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}








def flutterVersionCode = "553"
if (flutterVersionCode == null) {
    flutterVersionCode = '553'



}


def flutterVersionName = "5.5.3"

if (flutterVersionName == null) {
    flutterVersionName = '5.5.3'

}



apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

apply plugin: 'com.huawei.agconnect'

android {
    compileSdkVersion 34

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

    }
    kotlinOptions{
        jvmTarget = '1.8'
    }
    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'

        main { jniLibs.srcDirs = ['libs'] }
    }
  

    lintOptions {
        disable 'InvalidPackage'
        checkReleaseBuilds false 
        // disable 'InvalidPackage'
        // disable "Instantiatable"
        // checkReleaseBuilds false
        // abortOnError false
        
    }

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.naji.one_key"
        minSdkVersion 24
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

        ndk {
            //选择要添加的对应 cpu 类型的 .so 库。
            // abiFilters  'arm64-v8a', 'x86_64',  'mips64'   //魅族64位,不支持32位
            abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86_64','x86', 'mips', 'mips64'
        }

         lintOptions {
       
        checkReleaseBuilds false
    
        
    }

        manifestPlaceholders = [
                XG_ACCESS_ID    : '1500012875',
                XG_ACCESS_KEY   : 'AVR2GJERH0HC',
                HW_APPID        : '102832405',
                VIVO_APPID: "103886384",
                VIVO_APPKEY:"5a04e5c3485c0b19a2911c95dcaff5d2",
                PACKAGE_NAME    : "com.naji.one_key",// 小米通道
                AMAP_KEY : "dbced781d0acd36184d5b4b54da7188d"
        ]
    }

    signingConfigs {
        release {
            storeFile file("./src/main/assets/xiaotao.jks")
            storePassword "xt123456"
            keyAlias "key0"
            keyPassword "xt123456"
        }

        debug {
            storeFile file("./src/main/assets/xiaotao.jks")
            storePassword "xt123456"
            keyAlias "key0"
            keyPassword "xt123456"
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
        debug{
            minifyEnabled false
            // TODO: Add your own signing config for the release build.
            // Signing with the debug keys for now, so `flutter run --release` works.
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // signingConfig signingConfigs.release
            // minifyEnabled true
            // // TODO: Add your own signing config for the release build.
            // // Signing with the debug keys for now, so `flutter run --release` works.
            // proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            // signingConfig signingConfigs.release
        }
    }
}

flutter {
    source '../..'
}

    // configurations.all {
    //     resolutionStrategy {
    //         force 'androidx.core:core-ktx:1.6.0'
    //     }
    // }
    // configurations.all {
    //     resolutionStrategy.eachDependency {
    //         DependencyResolveDetails details ->
    //             def requested = details.requested
    //             if (requested.group == "androidx.appcompat") {
    //                 if (requested.name == "appcompat") {
    //                     details.useVersion "1.3.1" 
    //             }
    //     }
    // }

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    implementation 'com.tencent.tpns:huawei:1.2.0.3-release'// 华为推送
    implementation 'com.tencent.tpns:xiaomi:1.2.0.3-release'  // 小米推送
    implementation 'com.tencent.tpns:oppo:1.2.0.3-release'  // OPPO 推送
    implementation 'com.tencent.tpns:vivo:1.2.0.3-release'  // vivo 推送
    implementation 'com.amap.api:location:4.7.0'
    implementation 'com.zhihu.android:matisse:0.5.3-beta3'
    implementation 'com.github.bumptech.glide:glide:4.11.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.11.0'
}