Skip to content

Android lint error when upgrade to Android plugin 4.x #8799

Open
@dapengzhang0

Description

@dapengzhang0

Trying to upgrade Android plugin to 4.x as described in #8421 (comment) with some minor workarounds, the build failed with a lint error:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':grpc-android-interop-testing:lint'.
> Lint found errors in the project; aborting build.
  
  Fix the issues identified by lint, or add the following to your build script to proceed with errors:
  ...
  android {
      lintOptions {
          abortOnError false
      }
  }
  ...
  Errors found:
  
  /Users/zdapeng/git/grpc-java/android-interop-testing/src/main/AndroidManifest.xml:23: Error: Class referenced in the manifest, io.grpc.binder.HostServices$HostService1, was not found in the project or the libraries [MissingClass]
          <service android:name="io.grpc.binder.HostServices$HostService1"/>
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  /Users/zdapeng/git/grpc-java/android-interop-testing/src/main/AndroidManifest.xml:24: Error: Class referenced in the manifest, io.grpc.binder.HostServices$HostService2, was not found in the project or the libraries [MissingClass]
          <service android:name="io.grpc.binder.HostServices$HostService2"/>
                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Activity

added this to the Next milestone on Jan 4, 2022
dapengzhang0

dapengzhang0 commented on Jan 4, 2022

@dapengzhang0
MemberAuthor

The binder service names in android-interop-testing/src/main were introduced in #8563

@markb74 Is there a way to fix or workaround it?

markb74

markb74 commented on Jan 5, 2022

@markb74
Contributor

I'm ooo right now, but my guess is making the service classes non-inner classes would workaround the problem.

added a commit that references this issue on Jan 7, 2022
dapengzhang0

dapengzhang0 commented on Jan 10, 2022

@dapengzhang0
MemberAuthor

my guess is making the service classes non-inner classes would workaround the problem.

The service class is in project(':grpc-binder') and the android-interop-testing project does not have project(':grpc-binder') in its lintClasspath, so I think the lint check couldn't find the class .

I temporarily disabled lint for 'MissingClass' in https://github.com/grpc/grpc-java/pull/8808/files#diff-d9a8dd52c6811ac3eb0e4ed4d260817f55ce2b24ae9b629d4850373346415a6cR52 to workaround it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @ejona86@dapengzhang0@markb74

        Issue actions

          Android lint error when upgrade to Android plugin 4.x · Issue #8799 · grpc/grpc-java