Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration to AGP, gradle 8.0 and above #1486

Closed
AsifAliJohari opened this issue Aug 22, 2023 · 14 comments
Closed

Migration to AGP, gradle 8.0 and above #1486

AsifAliJohari opened this issue Aug 22, 2023 · 14 comments
Labels
More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed

Comments

@AsifAliJohari
Copy link

AsifAliJohari commented Aug 22, 2023

on Upgrade gradle version and using android studio grife, realm dependncy not resolve, there is some compitabilaty issue. Please guide . how to fixed it. i already upgrade project gradle. is there any beta version or aolution like for realm java sdk

@AsifAliJohari
Copy link
Author

on Upgrade gradle version and using android studio grife, realm dependncy not resolve, there is some compitabilaty issue. Please guide . how to fixed it. i already upgrade project gradle. is there any beta version or solution like for realm java sdk

@cmelchior
Copy link
Contributor

Hi @AsifAliJohari I tried to upgrade our Intro sample project to AGP 8 and Gradle 8. It seems to work fine if you adjust for a ew things. You can see it here: realm/realm-kotlin-samples#43

What exactly are the issue you are running into?

@florinleu
Copy link

Hi @cmelchior . We also bumped into some issues after upgrading to the latest Android Studio and gradle 8.3. This is the error we get when compiling:

Details: Internal error in file lowering: java.lang.AssertionError: Function 'setMutableInt' not found in class 'RealmObjectHelper'
	at io.realm.kotlin.compiler.IrUtilsKt.lookupFunction(IrUtils.kt:194)
	at io.realm.kotlin.compiler.IrUtilsKt.lookupFunction$default(IrUtils.kt:192)
	at io.realm.kotlin.compiler.AccessorModifierIrGeneration.<init>(AccessorModifierIrGeneration.kt:139)
	at io.realm.kotlin.compiler.RealmModelLowering.lower(RealmModelLoweringExtension.kt:96)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:101)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitClass(IrElementVisitorVoid.kt:111)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:92)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitClass(Lower.kt:92)
	at org.jetbrains.kotlin.ir.declarations.IrClass.accept(IrClass.kt:64)
	at org.jetbrains.kotlin.ir.declarations.IrFile.acceptChildren(IrFile.kt:36)
	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptChildrenVoid(IrVisitors.kt:15)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitElement(Lower.kt:96)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitPackageFragment(IrElementVisitorVoid.kt:190)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitPackageFragment(Lower.kt:92)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:200)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid$DefaultImpls.visitFile(IrElementVisitorVoid.kt:198)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.backend.common.ClassLoweringVisitor.visitFile(Lower.kt:92)
	at org.jetbrains.kotlin.ir.declarations.IrFile.accept(IrFile.kt:30)
	at org.jetbrains.kotlin.ir.visitors.IrVisitorsKt.acceptVoid(IrVisitors.kt:11)
	at org.jetbrains.kotlin.backend.common.LowerKt.runOnFilePostfix(Lower.kt:89)
	at io.realm.kotlin.compiler.RealmModelLowering.lower(RealmModelLoweringExtension.kt:56)
	at org.jetbrains.kotlin.backend.common.LowerKt.lower(Lower.kt:75)
	at io.realm.kotlin.compiler.RealmModelLoweringExtension.generate(RealmModelLoweringExtension.kt:45)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr$lambda$1(JvmIrCodegenFactory.kt:186)
	at org.jetbrains.kotlin.psi2ir.Psi2IrTranslator.generateModuleFragment(Psi2IrTranslator.kt:104)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:218)
	at org.jetbrains.kotlin.backend.jvm.JvmIrCodegenFactory.convertToIr(JvmIrCodegenFactory.kt:55)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.convertToIr(KotlinToJVMBytecodeCompiler.kt:225)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:102)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:47)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:167)
	at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:101)
	at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:47)
	at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:485)
	at org.jetbrains.kotlin.incremental.IncrementalJvmCompilerRunner.runCompiler(IncrementalJvmCompilerRunner.kt:131)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.doCompile(IncrementalCompilerRunner.kt:424)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileImpl(IncrementalCompilerRunner.kt:360)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compileNonIncrementally(IncrementalCompilerRunner.kt:242)
	at org.jetbrains.kotlin.incremental.IncrementalCompilerRunner.compile(IncrementalCompilerRunner.kt:98)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.execIncrementalCompiler(CompileServiceImpl.kt:625)
	at org.jetbrains.kotlin.daemon.CompileServiceImplBase.access$execIncrementalCompiler(CompileServiceImpl.kt:101)
	at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1746)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
	at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.lang.AssertionError: Function 'setMutableInt' not found in class 'RealmObjectHelper'

@cmelchior
Copy link
Contributor

@florinleu That looks like an incremental compilation error. Does it also happens if you do a clean build?

@florinleu
Copy link

Yes. The latest release that works is Realm 1.5.2.

@AsifAliJohari
Copy link
Author

Hi @cmelchior ,thanks for responce. sorry for late reply.
I am using realm kotlin sdk leatest version.
for android project with multi module
with gradle 8.0
IMG_20230824_102705_118.jpg

i found issue related to this problem in java sdk .i already mention above

@AsifAliJohari
Copy link
Author

AsifAliJohari commented Aug 24, 2023

Hi @AsifAliJohari I tried to upgrade our Intro sample project to AGP 8 and Gradle 8. It seems to work fine if you adjust for a ew things. You can see it here: realm/realm-kotlin-samples#43

What exactly are the issue you are running into?

i check it ,all step already follow.
I found that AGP remove transform library

@AsifAliJohari
Copy link
Author

Hi @cmelchior ,thanks for responce. sorry for late reply.
I am using realm kotlin sdk leatest version.
for android project with multi module
with gradle 8.0
IMG_20230824_102705_118.jpg

i found issue related to this problem in java sdk .i already mention above

Gradle with kotlin DSL and buildSrc

@AsifAliJohari
Copy link
Author

AsifAliJohari commented Aug 24, 2023

IMG_20230824_124254_017.jpg

@cmelchior this may help you understand problem

@AsifAliJohari
Copy link
Author

IMG_20230824_124254_017.jpg

@cmelchior may help you understand problem

in java sdk
IMG_20230824_125130_832.jpg

@AsifAliJohari
Copy link
Author

AsifAliJohari commented Aug 24, 2023

@cmelchior error goes after this change . but i not understand why this happen . is there any bugs ??? issue #1243 is similer also.
IMG_20230824_144253_401.jpg

@florinleu
Copy link

florinleu commented Sep 17, 2023

@cmelchior do you have any updates on this? We're still forced to use realm 1.5.2 even if the latest release is 1.11.1.

@cmelchior
Copy link
Contributor

@florinleu As far as we know, Realm should work with Gradle 8 and AGP 8. We have a branch here showing it: https://github.com/realm/realm-kotlin-samples/pull/43/files

Your stack trace above indicates that your plugin and dependency version are out of sync?

@sync-by-unito sync-by-unito bot added More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. Waiting-For-Reporter Waiting for more information from the reporter before we can proceed labels Oct 4, 2023
@github-actions
Copy link
Contributor

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@sync-by-unito sync-by-unito bot changed the title Migration to AGP, gradle 8.0 and above Migration to AGP, gradle 8.0 and above Feb 17, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
More-information-needed More information needed from the reporter. The issue will autoclose if no more information is given. O-Community Waiting-For-Reporter Waiting for more information from the reporter before we can proceed
Projects
None yet
Development

No branches or pull requests

3 participants