Describe the bug
Gradle build fails with the following error message:
/Users/sander/Fork/pomona-app/node_modules/@capacitor-community/file-opener/android/src/main/java/com/ryltsov/alex/plugins/file/opener/FileOpenerProvider.java:6: error: cannot access ContentProvider
public class FileOpenerProvider extends androidx.core.content.FileProvider {}
^
class file for android.content.ContentProvider not found
To Reproduce
Steps to reproduce the behavior:
npm install @capacitor-community/file-opener
inside a capacitor v3 project
npx cap sync android
- Make Capacitor build
- Open Android Studio and try to build app on a simulator (Pixel 5 API 32)
Expected behavior
I expect there to be no gradle errors when building the app with this plugin
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
We are using npx jetify
for androidX compatibility of some of our used dependencies
gradle.properties:
# Project-wide Gradle settings.
# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.
# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
org.gradle.java.home=/Applications/Android\ Studio.app/Contents/jre/Contents/Home
export JAVA_HOME=/Applications/Android\ Studio.app/Contents/jre/Contents/Home
variables.gradle:
ext {
minSdkVersion = 22
compileSdkVersion = 30
targetSdkVersion = 30
androidxActivityVersion = '1.2.0'
androidxAppCompatVersion = '1.2.0'
androidxCoordinatorLayoutVersion = '1.1.0'
androidxCoreVersion = '1.3.2'
androidxFragmentVersion = '1.3.0'
junitVersion = '4.13.1'
androidxJunitVersion = '1.1.2'
androidxEspressoCoreVersion = '3.3.0'
cordovaAndroidVersion = '7.0.0'
}
build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
apply from: "variables.gradle"
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app/build.gradle:
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation("androidx.appcompat:appcompat:$androidxAppCompatVersion") {
force = true
}
implementation project(':capacitor-android')
implementation 'androidx.webkit:webkit:1.4.0'
testImplementation "junit:junit:$junitVersion"
androidTestImplementation "androidx.test.ext:junit:$androidxJunitVersion"
androidTestImplementation "androidx.test.espresso:espresso-core:$androidxEspressoCoreVersion"
implementation project(':capacitor-cordova-android-plugins')
// Import the BoM for the Firebase platform
implementation platform('com.google.firebase:firebase-bom:28.4.2')
// Declare the dependencies for the Firebase Cloud Messaging and Analytics libraries
// When using the BoM, you don't specify versions in Firebase library dependencies
// implementation 'com.google.firebase:firebase-messaging'
implementation 'com.google.firebase:firebase-analytics'
implementation "com.google.firebase:firebase-iid"
}
bug wontfix