objectbox / objectbox-java

Android Database - first and fast, lightweight on-device vector database
https://objectbox.io
Apache License 2.0
4.33k stars 297 forks source link

Failed to apply plugin 'io.objectbox' - Android Studio Hedgehog | 2023.1.1 - Groovy DSL Gradle #1174

Closed hh-ahmad closed 1 month ago

hh-ahmad commented 3 months ago

Build info

Code

Code of build.gradle(:app) ```java [build.gradle(:app)] plugins { id 'com.android.application' id 'io.objectbox' } android { namespace 'com.example.objectboxjava' compileSdk 34 defaultConfig { applicationId "com.example.objectboxjava" minSdk 24 targetSdk 34 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } } compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } buildFeatures { buildConfig = true } } dependencies { implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'com.google.android.material:material:1.11.0' implementation 'androidx.constraintlayout:constraintlayout:2.1.4' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.5' androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' // objectbox libraries // implementation 'io.objectbox:objectbox-android:3.8.0' annotationProcessor 'io.objectbox:objectbox-processor:3.8.0' } apply plugin: 'io.objectbox' ```
Code of build.gradle(:Project) ```java // Top-level build file where you can add configuration options common to all sub-projects/modules. plugins { id 'com.android.application' version '8.2.0' apply false id 'custom-io.objectbox.objectbox-gradle-plugin' version '3.2.0' apply false } ```
Code of settings.gradle(:Project) ```java pluginManagement { repositories { google() mavenCentral() gradlePluginPortal() maven { url "https://objectbox.net/beta-repo/" setAllowInsecureProtocol(true); } } resolutionStrategy { eachPlugin { if (requested.id.namespace != null && requested.id.namespace.startsWith('custom-')) { useModule("${requested.id.namespace.substring(7)}:${requested.id.name}:${requested.version}") } } } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } } rootProject.name = "ObjectBoxJava" include ':app' ```

Logs, stack traces

Logs ```console Build file 'F:\LiteracyApps\ObjectBoxJava\app\build.gradle' line: 3 An exception occurred applying plugin request [id: 'io.objectbox'] > Failed to apply plugin 'io.objectbox'. > API 'android.registerTransform' is removed. * Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 2s ```
greenrobot-team commented 3 months ago

API 'android.registerTransform' is removed.

Thanks for reporting! Update to the latest version of the ObjectBox plugin, it supports newer versions of the Android plugin.

hh-ahmad commented 3 months ago

API 'android.registerTransform' is removed.

Thanks for reporting! Update to the latest version of the ObjectBox plugin, it supports newer versions of the Android plugin.

I am using the latest version of object-box library as mentioned in the code snippet 3.8.0.

Please share latest version of it and code snipped that describes the usage in latest Android Studio according to Gradle Plugins releases.

greenrobot-team commented 2 months ago

The code snippet uses an old plugin version:

id 'custom-io.objectbox.objectbox-gradle-plugin' version '3.2.0' apply false

The latest version right now is 3.8.0.

greenrobot-team commented 1 month ago

I guess this was resolved? Closing for now.