question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot find symbol startForeground(FOREGROUND_SERVICE_TYPE_MICROPHONE, notification);

See original GitHub issue

Bug report

  • I’ve checked the example to reproduce the issue.

At the time building the app, the package throwing error saying

/Users/ad/MY COOL APP/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java:59: error: cannot find symbol
import static android.content.pm.ServiceInfo.FOREGROUND_SERVICE_TYPE_MICROPHONE;
^
  symbol:   static FOREGROUND_SERVICE_TYPE_MICROPHONE
  location: class ServiceInfo

/Users/ad/MY COOL APP/node_modules/react-native-callkeep/android/src/main/java/io/wazo/callkeep/VoiceConnectionService.java:251: error: cannot find symbol
        startForeground(FOREGROUND_SERVICE_TYPE_MICROPHONE, notification);
                        ^
  symbol:   variable FOREGROUND_SERVICE_TYPE_MICROPHONE
  location: class VoiceConnectionService
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
  • Reproduced on:
  • Android
  • iOS

Description

Steps to Reproduce

Install the package, follow the installation process https://github.com/react-native-webrtc/react-native-callkeep/blob/master/docs/android-installation.md

Versions

- Callkeep: "^4.0.0"
- React Native: "0.63.2"

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
manuquentincommented, Nov 30, 2020

I’ll publish a fix today

2reactions
manuquentincommented, Nov 25, 2020

Thanks @ajitdas123 for the report, which version of Android do you have ? With which version of the android sdk do you compile ? We should maybe replace FOREGROUND_SERVICE_TYPE_MICROPHONE by 128 as suggested by @Pauligrinder for sdk <= 29.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Flutter/Android cannot find symbol startForeground()
I've been trying to get a background service working on Android. But Android keeps telling me that startForeground() cannot be found despite ...
Read more >
How to Resolve The Cannot Find Symbol Error in Java - Rollbar
The cannot find symbol error refers to a situation where the Java compiler is unable to find the symbol associated with a given...
Read more >
Fixing cannot find symbol in Java - YouTube
Common fixes for cannot find symbol in Java. This typically means a misspelling, variable or method that does not exist, or variable that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found