1

well before that I still haven't solved the problem of Huawei sign in link: https://forums.developer.huawei.com/forumPortal/en/topic/0201616708664590094?fbclid=IwAR2j7upjI62ISMICdVh9_MgArtzVbAFMXJ26vpfSh3t5wZ991tOuOsF06D8 in debug mode which I run on the emulator on my computer. To solve it I tried to use cloud debug, when using cloud debug I had to build my project to make it an application, then when I tried to build it I found an error as below

* What went wrong: Execution failed for task ':app:minifyReleaseWithR8'.   com.android.tools.r8.CompilationFailedException: Compilation failed to complete

* Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 29s Running Gradle task 'bundleRelease'...         
90.2s [!] The shrinker may have failed to optimize the Java bytecode.
    To disable the shrinker, pass the `--no-shrink` flag to this command.
    To learn more, see: https://developer.android.com/studio/build/shrink-code Gradle task bundleRelease failed with exit code 1

then I try to find if there is an error from the package and when I try to unplug the Huawei account package this is what happens

Unplugged

next, I tried to change the Gradle version because as can be seen earlier there is a log that says

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.

then see what happens

Plugged

I just don't know what should I do, because if it's still happening, I can't release the app using the account kit

Here is my latest build.gradle

APP Level

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 = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
    flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
    flutterVersionName = '1.0'
}

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

def keystoreProperties = new Properties()
   def keystorePropertiesFile = rootProject.file('key.properties')
   if (keystorePropertiesFile.exists()) {
       keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
   }

android {
    compileSdkVersion 30

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = '1.8'
    }

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

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.gky_cmn"
        minSdkVersion 20
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

    signingConfigs {       
       release {            
           keyAlias keystoreProperties['keyAlias']
           keyPassword keystoreProperties['keyPassword']
           storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
           storePassword keystoreProperties['storePassword']        
       }    
   }   
 
   buildTypes {        
       debug {            
           signingConfig signingConfigs.config        
        }       
        release {  
           minifyEnabled true
            shrinkResources true
           proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
           signingConfig signingConfigs.config        
       }    
    }

}

flutter {
    source '../..'
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

apply plugin: 'com.huawei.agconnect'

ANDROID Level

buildscript {
    ext.kotlin_version = '1.4.32'
    repositories {
        google()
        mavenCentral()
        maven {url 'https://developer.huawei.com/repo/'}
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.huawei.agconnect:agcp:1.4.1.300'
        classpath 'com.google.gms:google-services:3.2.1'
    }
}

allprojects {
    repositories {
        google()
        mavenCentral()
        maven {url 'https://developer.huawei.com/repo/'}
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

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

LOG --verbose https://ghostbin.com/paste/bkCr2

zhangxaochen
  • 32,744
  • 15
  • 77
  • 108
Theo
  • 51
  • 3
  • May i ask whether classpath 'com.android.tools.build:gradle:4.1.0' is the final version?And could you pls provide a more complete build.gradle file under the app level? Seems like the problem cannot be reproduced based on the content provided above. :( – zhangxaochen Jul 19 '21 at 11:10

1 Answers1

0

I read your questions on the Huawei forum. According to the logs, the HMS Core is not installed on your test device. In fact, the HMS SDK provides the function of downloading and installing the HMS Core. You can refer document. enter image description here

flybird
  • 51
  • 2