【问题标题】:Android Studio does not generate the debugging symbols to upload them to Google PlayAndroid Studio 不会生成调试符号以将它们上传到 Google Play
【发布时间】:2022-01-01 19:31:22
【问题描述】:

我正在编辑一个 android studio 模板,在生成 APK 或 AAB 时,它不会生成 google play 在任何地方问我的调试符号。

我的代码如下:

build.gradle(应用程序)

android {

    ndkVersion "22.1.7171670"
    compileSdkVersion 30
    defaultConfig {
        applicationId "com.rales"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode 4
        versionName "2.0"
        multiDexEnabled true

 
        externalNativeBuild {
            cmake {
                version "3.10.2.4988404"
            }
        }
    }

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true

            proguardFiles getDefaultProguardFile('proguard-android.txt'),
                    'proguard-rules.pro'

        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    lintOptions {
        disable 'GradleDependency'
    }
    useLibrary 'org.apache.http.legacy'
}


dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    //google support library
    implementation 'androidx.appcompat:appcompat:1.2.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.multidex:multidex:2.0.1'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'com.google.android.material:material:1.1.0'
    implementation 'com.google.android.gms:play-services-ads-lite:20.4.0'

    //analytics
    implementation platform('com.google.firebase:firebase-bom:28.2.0')
    implementation 'com.google.firebase:firebase-analytics'

    //Ad Networks
    implementation 'com.github.solodroidx:solodroid-ads-sdk:1.1.0'

    //notification
    implementation 'com.onesignal:OneSignal:4.4.1'

    //image library
    implementation 'com.squareup.picasso:picasso:2.71828'
    implementation 'com.makeramen:roundedimageview:2.3.0'

    //exoplayer
    implementation 'com.google.android.exoplayer:exoplayer-core:2.14.2'
    implementation 'com.google.android.exoplayer:exoplayer-dash:2.14.2'
    implementation 'com.google.android.exoplayer:exoplayer-hls:2.14.2'
    implementation 'com.google.android.exoplayer:exoplayer-ui:2.14.2'
    implementation 'com.google.android.exoplayer:exoplayer-rtsp:2.14.2'

    //rest API
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.okhttp3:okhttp:3.11.0'
    implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'

    //shimmer effect
    implementation 'com.balysv:material-ripple:1.0.2'
    implementation 'com.facebook.shimmer:shimmer:0.5.0'

    implementation 'org.ocpsoft.prettytime:prettytime:4.0.1.Final'

}

apply plugin: 'com.google.gms.google-services'

android.defaultConfig.ndk.debugSymbolLevel = 'FULL'

buil.gradle(项目)

buildscript {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
        maven { url 'https://jitpack.io' }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:4.2.2'
        classpath 'com.google.gms:google-services:4.3.10'
        classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.13.4'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
        maven { url 'https://startappdev.bintray.com/maven' }
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Local.properties

sdk.dir=C\:\\Users\\Unknow\\AppData\\Local\\Android\\Sdk
cmake.dir=C\:\\Users\\Unknow\\AppData\\Local\\Android\\Sdk\\cmake\\3.10.2.4988404
ndk.dir=C\:\\Users\\Unknow\\AppData\\Local\\Android\\sdk\\ndk\\22.1.7171670

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

我正在使用 Android Studio

Android Studio 北极狐 | 2020.3.1 补丁 3 内部版本号 AI-203.7717.56.2031.7784292,于 2021 年 9 月 30 日构建

在生成apk或aab时,不包含调试符号。

感谢您的帮助

【问题讨论】:

    标签: android android-studio debugging release android-app-bundle


    【解决方案1】:

    在构建 Android App Bundle 时,应自动将调试符号放入 .aab 文件中(至少在最新版本的 Android Gradle 插件中)。

    要验证,您可以将 AAB 文件作为 zip 文件打开(例如,重命名为 .zip),然后查找名为 BUNDLE-METADATA/com.android.tools.build.debugsymbols 的目录。

    【讨论】:

      猜你喜欢
      • 2022-07-08
      • 1970-01-01
      • 2018-02-08
      • 1970-01-01
      • 1970-01-01
      • 2021-11-20
      • 2018-08-23
      • 1970-01-01
      • 2014-12-30
      相关资源
      最近更新 更多