You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio Ladybug(2024.2.2)项目导入/构建耗时过长求助

Android Studio导入项目耗时过长问题求助

我遇到了Android Studio导入项目耗时过长的问题,已尝试以下操作但均未解决:

  • 升级堆内存大小、调整内存分配
  • 在gradle.properties中添加了以下配置:
org.gradle.parallel=true
org.gradle.daemon=true

项目的build.gradle配置如下:

plugins {
    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id 'com.google.gms.google-services'
    id 'com.google.firebase.crashlytics'
    //id 'newrelic'
    id 'hypersdk.plugin'

}
//apply plugin: 'kotlin-kapt'

android {
//    compileSdkVersion 34

    defaultConfig {
        compileSdk 34
        minSdkVersion 24
        targetSdkVersion 34
        versionCode 118
        versionName "12.4"

        testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
        signingConfig signingConfigs.debug
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }

    flavorDimensions "api"
    productFlavors {
        staging {
            buildConfigField("String", "API_BASE_URL", API_BASE_URL)
            buildConfigField("String", "API_CHECKSUM_URL", CHECKSUM_URL)
        }
        production {
            buildConfigField("String", "API_BASE_URL", API_BASE_URL)
            buildConfigField("String", "API_CHECKSUM_URL", CHECKSUM_URL)
        }
    }
    ndkVersion = "23.2.8568313"

//    buildToolsVersion '30.0.3'
//    buildToolsVersion '33.0.2'
//    buildToolsVersion '34.0.0'
    dependencies {

        implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
        //noinspection GradleCompatible
        implementation 'androidx.appcompat:appcompat:1.6.1'
        implementation 'androidx.core:core-ktx:1.13.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
        implementation 'com.google.android.material:material:1.11.0'
        implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.5.0'
        implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0'
        implementation 'androidx.navigation:navigation-fragment-ktx:2.5.0'
        implementation 'androidx.navigation:navigation-ui-ktx:2.5.0'
        implementation 'androidx.legacy:legacy-support-v4:1.0.0'
        testImplementation 'junit:junit:4.13.2'
        androidTestImplementation 'androidx.test.ext:junit:1.1.5'
        androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
        implementation("androidx.cardview:cardview:1.0.0")
        //Google Map
        implementation 'com.google.android.gms:play-services-maps:18.2.0'
        implementation 'com.google.android.gms:play-services-location:21.2.0'
        implementation 'com.google.maps.android:android-maps-utils:2.2.0'
        implementation 'com.google.android.libraries.places:places:3.0.0'
//        implementation 'com.android.volley:volley:1.2.1'
        //Retrofit
        implementation 'com.squareup.okhttp3:okhttp:4.11.0'
        implementation 'com.squareup.retrofit2:retrofit:2.9.0'
        implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
        implementation 'com.squareup.retrofit2:converter-scalars:2.9.0'
        //Gson
        implementation 'com.google.code.gson:gson:2.8.9'
        implementation 'com.squareup.okhttp3:logging-interceptor:4.9.2'

        //Lottie animation
        implementation 'com.airbnb.android:lottie:5.1.1'
        //Glide Image Loader
        //implementation 'com.github.bumptech.glide:glide:4.12.0'
        implementation 'com.github.bumptech.glide:glide:4.13.2'
        //implementation 'com.github.corouteam:GlideToVectorYou:v2.0.0'
        implementation 'com.github.2coffees1team:GlideToVectorYou:v2.0.0'

        //Dexter for run time permission
        implementation 'com.karumi:dexter:6.2.3'

        //OK Http
//        implementation 'com.squareup.okhttp:okhttp:2.7.5'

        //payumoney sdk
//        implementation 'in.payu:payu-checkout-pro:2.0.19'
        implementation 'in.payu:payu-checkout-pro:2.3.1'
        //scanner
        implementation('com.journeyapps:zxing-android-embedded:4.2.0') { transitive = false }
        // Not upgrade, because otherwise will work only on api > 24
        implementation 'com.google.zxing:core:3.4.0'
        //charts
        implementation 'com.github.PhilJay:MPAndroidChart:v3.1.0'
        //Omni BLE lock lib
        implementation 'com.omni.support:ble:1.7.4'
        //pin view
        implementation 'com.github.aabhasr1:OtpView:v1.1.2-ktx' // kotlin
        //pdf view
        implementation 'com.github.afreakyelf:Pdf-Viewer:v1.0.7'
        //implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:0.20.0")
        //zoho
//    implementation 'com.zoho.salesiq:mobilisten:4.2.9'
//    implementation 'com.zoho.salesiq:mobilisten:4.4.0'
        implementation 'com.zoho.salesiq:mobilisten:5.1.0'

        //Firebase
        implementation 'com.google.firebase:firebase-messaging:24.0.0'
        implementation(platform("com.google.firebase:firebase-bom:33.0.0"))
        implementation 'com.google.firebase:firebase-crashlytics-ktx'
        implementation 'com.google.firebase:firebase-analytics-ktx'

        //Record Video
        implementation 'com.github.MasayukiSuda:CameraRecorder-android:v0.1.5'
        implementation 'com.google.android.exoplayer:exoplayer:2.17.1'
        //in-app review by google
        implementation 'com.google.android.play:review-ktx:2.0.1'

        //for test purpose using this sdk
        //implementation 'io.sentry:sentry-android:6.6.0'

        implementation 'com.intuit.ssp:ssp-android:1.1.0'
        
        //mapbox sdk
        implementation 'com.mapbox.maps:android:11.3.1'
        implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:7.0.0'
//        implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:6.12.0'


        //old
        /*implementation 'com.mapbox.maps:android:10.8.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-android-sdk:8.1.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-sdk-services:6.7.0'
        implementation 'com.mapbox.mapboxsdk:mapbox-sdk-turf:6.7.0'*/

        //new paytm sdk
//    implementation 'com.paytm.appinvokesdk:appinvokesdk:1.6.13'
//    implementation 'com.paytm.appinvokesdk:appinvokesdk:1.6.15'
        implementation 'com.paytm.appinvokesdk:appinvokesdk:1.6.17'

        //tooltip
        implementation 'com.tomergoldst.android:tooltips:1.1.1'

        //relic lib
        //implementation 'com.newrelic.agent.android:android-agent:6.9.2'

        //Auto fetch OTP
        implementation 'com.google.android.gms:play-services-auth:20.5.0'
        implementation 'com.google.android.gms:play-services-auth-api-phone:18.0.1'

        //Step Progress bar for payment integration
        implementation 'com.anton46:stepsview:0.0.2'

        //For Handel thread
        implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

        //facebook sdk
        implementation 'com.facebook.android:facebook-android-sdk:[8,9)'

        //For Image Picker
        implementation 'io.github.ParkSangGwon:tedimagepicker:1.4.2'

        //For Branch.io (deep link)
//        implementation 'io.branch.sdk.android:library:5.8.0'

    }
    buildFeatures {
        viewBinding true
    }
    lintOptions {
        checkReleaseBuilds false
    }
    externalNativeBuild {
        cmake {
            version "3.10.2"
        }
    }
}

以上操作均未解决问题,恳请各位提供技术帮助。

内容的提问来源于stack exchange,提问作者Vishal Shah

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.15 22:04:58