HMS-Core / hms-react-native-plugin

This repo contains all of React-Native HMS plugins.
https://developer.huawei.com/consumer/en/doc/overview/HMS-Core-Plugin?ha_source=hms1
Apache License 2.0
235 stars 67 forks source link

HMS-Account Integration Error on React Native 0.73.1 #321

Open mohshbool opened 2 months ago

mohshbool commented 2 months ago

Description Unable to integrate with React Native 0.73.1 using "@hmscore/react-native-hms-account": "^6.12.0-300"

Expected behavior For the app to run

Current behavior App is not building

Screenshots N/A

Logs

   > Could not find com.huawei.agconnect:agconnect-core:1.9.1.300.
     Required by:
         project :app
   > Could not find com.huawei.hms:hwid:6.12.0.300.
     Required by:
         project :app

Environment

Other build.gradle:

buildscript {
    ext {
        buildToolsVersion = "34.0.0"
        minSdkVersion = 21
        compileSdkVersion = 34
        targetSdkVersion = 34
        ndkVersion = "25.1.8937393"
        kotlinVersion = "1.8.0"
        googlePlayServicesAuthVersion = "20.7.0"
    }
    repositories {
        google()
        mavenCentral()
        maven {url "https://developer.huawei.com/repo/"}
    }
    dependencies {
        classpath("com.android.tools.build:gradle:8.1.1")
        classpath("com.facebook.react:react-native-gradle-plugin")
        classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
        classpath("com.google.gms:google-services:4.4.1")
        classpath("com.huawei.agconnect:agcp:1.9.1.300")
    }
}

apply plugin: "com.facebook.react.rootproject"

app/build.gradle:

apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.huawei.agconnect'

react {}

def enableProguardInReleaseBuilds = false

def jscFlavor = 'org.webkit:android-jsc:+'

android {
    ndkVersion rootProject.ext.ndkVersion
    buildToolsVersion rootProject.ext.buildToolsVersion
    compileSdk rootProject.ext.compileSdkVersion

    namespace "com.example.app"
    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion rootProject.ext.minSdkVersion
        targetSdkVersion rootProject.ext.targetSdkVersion
        versionCode 1
        versionName "1.0"
    }
    signingConfigs {
        debug {
            storeFile file('example-key.keystore')
            storePassword 'password'
            keyAlias 'example-alias'
            keyPassword 'password'
        }
        release {
            storeFile file('example-key.keystore')
            storePassword 'password'
            keyAlias 'example-alias'
            keyPassword 'password'
        }
    }
    buildTypes {
        debug {
            signingConfig signingConfigs.debug
        }
        release {
            signingConfig signingConfigs.release
            minifyEnabled enableProguardInReleaseBuilds
            proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
        }
    }
}

dependencies {
    implementation("com.facebook.react:react-android")
    implementation("com.facebook.react:flipper-integration")

    if (hermesEnabled.toBoolean()) {
        implementation("com.facebook.react:hermes-android")
    } else {
        implementation jscFlavor
    }

    implementation 'com.huawei.agconnect:agconnect-core:1.9.1.300'
    implementation 'com.huawei.hms:hwid:6.12.0.300'
}

apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)