HMS-Core / hms-mapkit-demo

HMS Map Kit demo provides an example of intergrating HMS Map Android SDK. Personalizing how your map displays and interacts with your users tailors their experience to them
https://developer.huawei.com/consumer/en/hms/huawei-MapKit?ha_source=hms1
Apache License 2.0
115 stars 43 forks source link

Getting Stackoverflow error when compiling my project in android studio #16

Open ghost opened 2 years ago

ghost commented 2 years ago

Describe the bug Currently, I'm using these many HMS-core libraries along with some google libraries in my project.

    implementation 'com.google.android.gms:play-services-base:17.6.0'
    implementation 'com.google.android.gms:play-services-maps:18.0.0'
    implementation 'com.google.android.gms:play-services-location:18.0.0'
    implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
    implementation 'com.google.android.gms:play-services-auth:19.2.0'

    implementation 'com.huawei.hms:location:6.2.0.300'
    implementation 'com.huawei.hms:site:6.2.0.301'
    implementation 'com.huawei.hms:maps:6.2.0.301'
    implementation 'com.huawei.hms:push:6.1.0.300'
    implementation 'com.huawei.hms:scan:2.2.0.300'

and In my app->Build.gradle these many plugins I'm using

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.android.gms.oss-licenses-plugin'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-parcelize'
apply plugin: 'com.huawei.agconnect'

When compiling and installing apk in the emulator at that time I'm getting this error. please check the attached screenshots.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:getDependencies'.
> java.lang.StackOverflowError (no error message)

Screenshots image image

Desktop (please complete the following information):

Additional context Note: If I'm commenting out this line or using older versions of gms libraries in that case it works fine. // apply plugin: 'com.google.android.gms.oss-licenses-plugin'

implementation 'com.huawei.hms:location:5.1.0.303'
implementation 'com.huawei.hms:site:6.0.0.300'
implementation 'com.huawei.hms:maps:6.0.0.301'
implementation 'com.huawei.hms:push:5.3.0.301'
implementation 'com.huawei.hms:scan:2.2.0.300'

Is there a workaround for this issue? kindly, suggest.

Mike-mei commented 2 years ago

May i ask will there still facing this issue if you do not reference the HMS libraries ?

ghost commented 2 years ago

Yes, even with

implementation 'com.huawei.hms:location:5.1.0.303'
implementation 'com.huawei.hms:site:6.0.0.300'
implementation 'com.huawei.hms:maps:6.0.0.301'
implementation 'com.huawei.hms:push:5.3.0.301'
implementation 'com.huawei.hms:scan:2.2.0.300'

these versions working fine, but when I'm using the latest versions of HMS libraries at that time facing issues,

Here, attaching your mapkit demo for your reference. kotlin.zip

Mike-mei commented 2 years ago

Please try to update the AppGallery Connect Plugin, the latest version is classpath 'com.huawei.agconnect:agcp:1.6.1.300'

ghost commented 2 years ago

yes, I have tried that one also but didn't work.

image

Mike-mei commented 2 years ago

Try to add implementation ‘com.huawei.hms:network-common:5.0.7.300’ before all HMS dependencies

ghost commented 2 years ago

yes, by using

implementation ‘com.huawei.hms:network-common:5.0.7.300’

I can able to create Build but, I want to ask by using this lib is there a Knock-on effect on other functionality?

Because after using this solution my site query suggestion searching API always gives errors.

HMSSDK_TaskApiCall: doExecute, uri:site.querySuggestion, errorCode:1212, transactionId:101677875estion20211206113837991921108
HmsSiteKit_QuerySuggestionTaskApiCall_70: responseErrorCode errorCode = 1212 errorReason = need update kit

If I use the old version build everything works fine, I can get proper response from site query suggestion searching API.

Please let me know.

Mike-mei commented 2 years ago

Sorry, it's a bug. We will fix that in 6.3.0 version. The next version will be released in the end of December or the middle of January.

Mike-mei commented 2 years ago

yes, by using

implementation ‘com.huawei.hms:network-common:5.0.7.300’

I can able to create Build but, I want to ask by using this lib is there a Knock-on effect on other functionality?

Because after using this solution my site query suggestion searching API always gives errors.

HMSSDK_TaskApiCall: doExecute, uri:site.querySuggestion, errorCode:1212, transactionId:101677875estion20211206113837991921108
HmsSiteKit_QuerySuggestionTaskApiCall_70: responseErrorCode errorCode = 1212 errorReason = need update kit

If I use the old version build everything works fine, I can get proper response from site query suggestion searching API.

Please let me know.

About the errorCode:1212, please try to update the hms core version, you can reference this document

ghost commented 2 years ago

Okay, will wait for new updates, Thank you for your support.

Mike-mei commented 2 years ago

@dixitpTheaa This issue have been sloved in the latest release, please try again.

ghost commented 2 years ago

Okay, thank you, for your support.