BUG: Content Resolver symbols versioning issue with API < 19

Just wanted to report a runtime startup crash issue when using the latest juce7 (as of 21 July 2022) with an Android device running an OS API less than 19. A simple patch was required in modules/juce_core/native/juce_android_Files.cpp, seems like just a copy/paste oversight.

--- a/deps/juce/modules/juce_core/native/juce_android_Files.cpp
+++ b/deps/juce/modules/juce_core/native/juce_android_Files.cpp
@@ -45,7 +45,7 @@ DECLARE_JNI_CLASS (ContentResolver, "android/content/ContentResolver")
  METHOD (releasePersistableUriPermission,   "releasePersistableUriPermission",  "(Landroid/net/Uri;I)V") \
  METHOD (getPersistedUriPermissions,        "getPersistedUriPermissions",       "()Ljava/util/List;")
 
-DECLARE_JNI_CLASS (ContentResolver19, "android/content/ContentResolver")
+DECLARE_JNI_CLASS_WITH_MIN_SDK (ContentResolver19, "android/content/ContentResolver", 19)
 #undef JNI_CLASS_MEMBERS
 
 #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD, CALLBACK) \

Thanks for reporting, this should be fixed on develop:

1 Like