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

Android 14 targetted build fails with RECEIVER_EXPORTED variable error #2089

Closed
NorthFred opened this issue Apr 22, 2024 · 4 comments
Closed

Comments

@NorthFred
Copy link

NorthFred commented Apr 22, 2024

Bug Report

Plugin(s)

Share Plugin @capacitor/share": "^6.0.0

Capacitor Version

Latest Dependencies:

  @capacitor/cli: 6.0.0
  @capacitor/core: 6.0.0
  @capacitor/android: 6.0.0
  @capacitor/ios: 6.0.0

Installed Dependencies:

  @capacitor/ios: not installed
  @capacitor/cli: 6.0.0
  @capacitor/core: 6.0.0
  @capacitor/android: 6.0.0

Platform(s)

Android 14 (target API level 34)

Current Behavior

Android build fails with output:

C:\.........\node_modules\@capacitor\share\android\src\main\java\com\capacitorjs\plugins\share\SharePlugin.java:49: error: cannot find symbol
            ContextCompat.RECEIVER_EXPORTED
                         ^
  symbol:   variable RECEIVER_EXPORTED
  location: class ContextCompat

Expected Behavior

Android build is successful.

Other Technical Details

Additional Context

@fmp777
Copy link

fmp777 commented Apr 22, 2024

same here

@fmp777
Copy link

fmp777 commented Apr 22, 2024

update: I do not get this issue with a fresh app, running npx cap add android, updating Android Studio and making sure the latest sdks are installed.

@NorthFred
Copy link
Author

NorthFred commented May 7, 2024

The error disappears when using updated variables.gradle file during building:

ext {
    minSdkVersion = 24
    compileSdkVersion = 34
    targetSdkVersion = 34
    androidxActivityVersion = '1.7.0'
    androidxAppCompatVersion = '1.6.1'
    androidxCoordinatorLayoutVersion = '1.2.0'
    androidxCoreVersion = '1.10.0'
    androidxFragmentVersion = '1.5.6'
    coreSplashScreenVersion = '1.0.0'
    androidxWebkitVersion = '1.6.1'
    junitVersion = '4.13.2'
    androidxJunitVersion = '1.1.5'
    androidxEspressoCoreVersion = '3.5.1'
    cordovaAndroidVersion = '10.1.1'
}

@NorthFred
Copy link
Author

Closing this.

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

No branches or pull requests

3 participants