fix(android): Auto-detect Java/SDK and fix KAPT Java 17+ compatibility

- Auto-detect Java from Android Studio (JBR/JRE) or system PATH
- Auto-detect Android SDK from common locations or local.properties
- Auto-write SDK location to local.properties for Gradle
- Add KAPT JVM args to gradle.properties for Java 17+ module access
- Fix Java version command quoting for paths with spaces
- Comment out DailyNotificationPlugin (Java class not implemented)

Eliminates manual JAVA_HOME/ANDROID_HOME setup requirements and fixes
KAPT compilation errors when using Java 17+.

Author: Matthew Raymer
This commit is contained in:
Matthew
2026-02-02 02:06:44 -08:00
parent 1345118b79
commit d0878507a6
9 changed files with 173 additions and 8 deletions

View File

@@ -18,6 +18,7 @@ dependencies {
implementation project(':capacitor-share')
implementation project(':capacitor-status-bar')
implementation project(':capawesome-capacitor-file-picker')
implementation project(':timesafari-daily-notification-plugin')
}

View File

@@ -56,8 +56,8 @@
<receiver
android:name="com.timesafari.dailynotification.NotifyReceiver"
android:enabled="true"
android:exported="false">
</receiver>
android:exported="false"
/>
<receiver
android:name="com.timesafari.dailynotification.BootReceiver"
@@ -89,7 +89,7 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-feature android:name="android.hardware.camera" android:required="true" />
<!-- Daily Notification Plugin Permissions -->
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />

View File

@@ -35,6 +35,10 @@
"pkg": "@capawesome/capacitor-file-picker",
"classpath": "io.capawesome.capacitorjs.plugins.filepicker.FilePickerPlugin"
},
{
"pkg": "@timesafari/daily-notification-plugin",
"classpath": "com.timesafari.dailynotification.DailyNotificationPlugin"
},
{
"pkg": "SafeArea",
"classpath": "app.timesafari.safearea.SafeAreaPlugin"

View File

@@ -68,7 +68,8 @@ public class MainActivity extends BridgeActivity {
registerPlugin(SharedImagePlugin.class);
// Register DailyNotification plugin
registerPlugin(com.timesafari.dailynotification.DailyNotificationPlugin.class);
// TODO: Uncomment when DailyNotificationPlugin Java class is implemented
// registerPlugin(com.timesafari.dailynotification.DailyNotificationPlugin.class);
// Initialize SQLite
//registerPlugin(SQLite.class);