Closed Bug 1621848 Opened 2 years ago Closed 2 years ago

messaging_example build fails with "error: cannot find symbol setMessageDelegate"

Categories

(GeckoView :: General, defect, P1)

Unspecified
All
defect

Tracking

(firefox76 fixed)

RESOLVED FIXED
mozilla76
Tracking Status
firefox76 --- fixed

People

(Reporter: botond, Assigned: agi)

Details

(Whiteboard: [geckoview:m76])

Attachments

(2 files)

STR

  1. Build recent mozilla-central for Android
  2. Run ./mach gradle installWithGeckoBinariesDebugAndroidTest

Actual results

The command fails with:

> Task :messaging_example:compileWithGeckoBinariesDebugJavaWithJavac FAILED
/home/botond/dev/mozilla/refactoring/mobile/android/examples/messaging_example/app/src/main/java/org/mozilla/geckoview/example/messaging/MainActivity.java:64: error: cannot find symbol
        session.setMessageDelegate(extension, messageDelegate, "browser");
               ^
  symbol:   method setMessageDelegate(WebExtension,MessageDelegate,String)
  location: variable session of type GeckoSession
1 error

Expected results

The command succeeds.

Regression from bug 1616625?

Flags: needinfo?(agi)

Side note:

  1. Run ./mach gradle installWithGeckoBinariesDebugAndroidTest

I thought this command was supposed to install the "test runner" application that's needed to run mochitests and such. (The reason I use it is so that I can subsequently run ./mach mochitest with --no-install and not be prompted whether I want to install the test application.)

But it's actually (also) building a messaging_example application? Is it supposed to be doing that?

./mach static-analysis check-java --outgoing is failure due to this.

(In reply to Botond Ballo [:botond] from comment #2)

Side note:

  1. Run ./mach gradle installWithGeckoBinariesDebugAndroidTest

I thought this command was supposed to install the "test runner" application that's needed to run mochitests and such. (The reason I use it is so that I can subsequently run ./mach mochitest with --no-install and not be prompted whether I want to install the test application.)

But it's actually (also) building a messaging_example application? Is it supposed to be doing that?

I think Gradle applies your command to all projects unless one is specified. Try ./mach gradle geckoview:installWithGeckoBinariesDebugAndroidTest

Assignee: nobody → agi
Priority: -- → P1
Summary: `mach gradle installWithGeckoBinariesDebugAndroidTest` fails with "error: cannot find symbol setMessageDelegate" → messaging_example build fails with "error: cannot find symbol setMessageDelegate"
Whiteboard: [geckoview:m76]

(In reply to James Willcox (:snorp) (jwillcox@mozilla.com) (he/him) from comment #4)

I think Gradle applies your command to all projects unless one is specified. Try ./mach gradle geckoview:installWithGeckoBinariesDebugAndroidTest

Thanks, that explains why ./mach mochitest without --no-install was succeeding -- it knows to run the more specific command ./mach gradle geckoview:installWithGeckoBinariesDebugAndroidTest. (And now I know too!)

Thanks for the report, working on it.

Flags: needinfo?(agi)
Pushed by asferro@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/8e5f07a8b0b5
Fix setMessageDelegate API change in example. r=aklotz
https://hg.mozilla.org/integration/autoland/rev/ef28db75f142
Build examples during |mach build|. r=aklotz
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla76
You need to log in before you can comment on or make changes to this bug.