Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[huawei_ads] Compile Error after Upgrade to Gradle plugin 8.3 #393

Open
yuhangang opened this issue Sep 18, 2024 · 9 comments
Open

[huawei_ads] Compile Error after Upgrade to Gradle plugin 8.3 #393

yuhangang opened this issue Sep 18, 2024 · 9 comments

Comments

@yuhangang
Copy link

yuhangang commented Sep 18, 2024

Description
I am trying to migrate my project to using Flutter engine v3.24, which bump Android gradle plugin version to 8.X.

Initially getting compilation error, which I believe that it's due to HMS plugins haven't supported gradle 8.X yet.
image

Then i tried to added following lines build.gradle to resolve the error,
image

But I ended up with getting following error which complain that com.huawei.android.hms.ppskit.IPPSChannelInfoServicedoes not exist
image

Logs
Post logs here or paste them to Ghostbin and insert the link here.

Environment

  • Platform: Flutter
  • Kit: Ads
  • Kit Version 13.4.72+300
  • OS Version 13
  • Android Studio version 2024.1.2
@qwertyway
Copy link

We are facing the same issue. Tried different workarounds, nothing helped

@Hayolox
Copy link

Hayolox commented Oct 23, 2024

same issue

@husainazkas
Copy link

husainazkas commented Nov 1, 2024

this happened to ALL FLUTTER PACKAGES that haven't set namespace to their build.gradle due to gradle 8.0 migration. To fix this issue, please @ozkulbeng add this following configuration to each package in this repo:

android {
    ....
    if (project.android.hasProperty("namespace")) {
        namespace("{app_id}")
    }
    ....
}

@Jasco07122021
Copy link

this happened to ALL FLUTTER PACKAGES that haven't set namespace to their build.gradle due to gradle 8.0 migration. To fix this issue, please @ozkulbeng add this following configuration to each package in this repo:

android {
    ....
    if (project.android.hasProperty("namespace")) {
        namespace("{app_id}")
    }
    ....
}

this is not working

@husainazkas
Copy link

@Jasco07122021 are you sure? how you configure it or just let me know which package do you use.

@qwertyway
Copy link

Any updates on this?

It's been almost two months already, and we're unable to make Huawei releases of all our projects

@EArminjon
Copy link

EArminjon commented Nov 19, 2024

#397

Usage example until merge

  # From 6.12.0+303 https://github.com/HMS-Core/hms-flutter-plugin/pull/397
  huawei_location:
    git:
      url: https://github.com/HMS-Core/hms-flutter-plugin
      path: flutter-hms-location
      ref: 9d47f5aaa11d4474b37b83e42d073f05ebaa2e24

@qwertyway
Copy link

qwertyway commented Dec 9, 2024

I did some deeper investigation and found out the reason and workaround.

Reason: IPPSChannelInfoService uses aidl and since gradle 8 aidl is disabled by default, it should be enabled on the project/module level

Workaround for developers: add this to your project-level build.gradle file, section allprojects. After this I was able to build my app with Huawei libraries

allprojects {
  ...
  subprojects {
        afterEvaluate { project ->
            if (project.hasProperty('android')) {
                project.android {
                    if (namespace == null) {
                        namespace project.group
                    }
                }
                if (project.group == 'com.huawei.hms.flutter.ads') {
                     project.android.buildFeatures.aidl true
                }
            }   
        }
    }
}

By the way, it also fixes another problem of huawei libraries - lack of namespaces

Suggestion to Huawei: add namespaces and aidl support (where needed) to your libraries (app-level build.gradle, android section)

android {
    namespace 'com.huawei.....'
    ...    
    buildFeatures {
        aidl = true
    }
    ...
}

@yuhangang
Copy link
Author

@qwertyway This workaround works on my end, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants