Fixed two build issues preventing Android plugin compilation:
1. Build script now builds from test app context instead of standalone
- Capacitor Android is only available as a project dependency, not from Maven
- Plugin must be built within a Capacitor app's Android project
- Changed build_plugin_for_test_app() to build from test app's android/
directory where Capacitor is available as :capacitor-android project
2. Added JVM arguments for Java 17+ KAPT compatibility
- Java 21's module system blocks KAPT from accessing internal compiler classes
- Added --add-opens flags to both org.gradle.jvmargs and kotlin.daemon.jvmargs
- Kotlin compiler daemon runs separately and needs its own configuration
- Applied to both plugin and test app gradle.properties files
These changes allow the plugin to build successfully with Java 21 and ensure
it's built in the correct context where Capacitor dependencies are available.
55 lines
2.5 KiB
Properties
55 lines
2.5 KiB
Properties
# Project-wide Gradle settings for Daily Notification Plugin
|
|
|
|
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
# AndroidX library
|
|
android.useAndroidX=true
|
|
|
|
# Automatically convert third-party libraries to use AndroidX
|
|
android.enableJetifier=true
|
|
|
|
# Kotlin code style for this project: "official" or "obsolete":
|
|
kotlin.code.style=official
|
|
|
|
# Enables namespacing of each library's R class so that its R class includes only the
|
|
# resources declared in the library itself and none from the library's dependencies,
|
|
# thereby reducing the size of the R class for that library
|
|
android.nonTransitiveRClass=true
|
|
|
|
# Enable Gradle build cache
|
|
org.gradle.caching=true
|
|
|
|
# Enable parallel builds
|
|
org.gradle.parallel=true
|
|
|
|
# Increase memory for Gradle daemon
|
|
# Java 17+ requires --add-opens flags for KAPT to access internal compiler classes
|
|
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
|
|
|
# Kotlin compiler daemon JVM arguments (required for KAPT with Java 17+)
|
|
# The Kotlin daemon runs separately and needs the same --add-opens flags
|
|
kotlin.daemon.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
|
|
--add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED
|
|
|
|
# Enable configuration cache
|
|
org.gradle.configuration-cache=true
|
|
|