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

Kotlin 1.3.72 #35

Closed
aminghadersohi opened this issue Apr 25, 2020 · 9 comments · Fixed by #42
Closed

Kotlin 1.3.72 #35

aminghadersohi opened this issue Apr 25, 2020 · 9 comments · Fixed by #42
Labels
bug Something isn't working
Milestone

Comments

@aminghadersohi
Copy link

aminghadersohi commented Apr 25, 2020

Are there any plans to update to kotlin 1.3.72?

const val kotlin = "1.3.61"

I am experiencing issues after I upgraded to koltin to 1.3.72 in my project.

java.lang.NoSuchMethodError: kotlinx.serialization.json.JsonConfiguration.copy$default(Lkotlinx/serialization/json/JsonConfiguration;ZZZZZLjava/lang/String;ZLjava/lang/String;Lkotlinx/serialization/UpdateMode;ILjava/lang/Object;)Lkotlinx/serialization/json/JsonConfiguration;

	at pbandk.Message$DefaultImpls.jsonMarshal(Message.kt:11)
	at com.generated.analytics.model.AppAnalyticsEvent.jsonMarshal(app.kt:35)
	at com.analytics.rapidfire.retrofit.pbandk.ConverterFactoryTest.ResponseBodyConverter - given json content type, should return message(ConverterFactoryTest.kt:185)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
@garyp garyp added bug Something isn't working enhancement New feature or request and removed enhancement New feature or request labels Apr 25, 2020
@garyp
Copy link
Collaborator

garyp commented Apr 25, 2020

Hi @aminghadersohi. PR #29 that adds Kotlin/Native support is also updating pbandk to Kotlin 1.3.72. That will probably get merged in the next couple weeks and included in pbandk 0.9.0.

I believe the cause of your problem is that your project is using Kotlin 1.3.72 but pbandk depends on kotlinx.serialization 0.14.0. The kotlinx.serialization library has a tight dependency to the version of Kotlin used. So kotlinx.serialization 0.14.0 only works with Kotlin 1.3.6x, whereas you need kotlinx.serialization 0.20.0 if you're using Kotlin 1.3.7x.

@garyp
Copy link
Collaborator

garyp commented Apr 25, 2020

As an aside: if you're using pbandk's JSON support I should warn you that the implementation is going to change significantly. The current implementation does not support the full protobuf JSON spec and also imposes a dependency from the generated code on the kotlinx.serialization compiler plugin. We're planning to reimplement JSON to allow full support for the protobuf JSON spec. We'll hopefully also be able to hide kotlinx.serialization as a runtime implementation detail, rather than something that's part of pbandk's public API (as it currently is).

@aminghadersohi
Copy link
Author

@garyp thanks for help. As you suspected we were not able to update to 1.3.72 even with using kotlinx.serialization-runtime 0.20.0. A couple of weeks doesn't sound unreasonable so we will most likely wait for that.
We are only using the JSON deserialization for on use case where we convert a very simple (flat 5 attribute) JSON object to a proto object, and its working well. As long as the functionality doesn't break, we should be ok right? Here is our object:

message ApiResponse {
  google.protobuf.StringValue id = 1;
  google.protobuf.Int64Value status = 2;
  google.protobuf.StringValue message = 3;
  google.protobuf.Int64Value time = 4;
  google.protobuf.Int64Value count = 5;
}

@aminghadersohi
Copy link
Author

@garyp is there an estimated release date for 0.9.0? And any way I can help make this faster?

@sebleclerc
Copy link
Contributor

I will update Kotlin version to 1.3.72 in PR #29. It is currently using 1.3.71, so it shouldn't be of any problem.

@garyp garyp added this to the 0.9.0 milestone Apr 29, 2020
@garyp
Copy link
Collaborator

garyp commented Apr 29, 2020

@aminghadersohi:

We are only using the JSON deserialization for on use case where we convert a very simple (flat 5 attribute) JSON object to a proto object, and its working well. As long as the functionality doesn't break, we should be ok right?

The JSON deserialization shouldn't break. Our current version doesn't cover all of the cases that the protobuf JSON spec requires, so we need to expand our support for JSON. But the subset of JSON that is working today will still work the same in the new version.

What will change is the jsonMarshal()/jsonUnmarshal() API.

@garyp is there an estimated release date for 0.9.0? And any way I can help make this faster?

Use of the Kotlin Multiplatform Plugin (already merged) and Kotlin/Native support are the only features we're targeting for 0.9.0. Once those are ready, we can release 0.9.0. Where we could use help to get the release out faster is in updating the examples and related documentation to use the new pbandk that's based on the Multiplatform Plugin (see #37).

@tinder-aminghadersohi
Copy link
Contributor

Given the examples are currently broken and I haven't been able to have a look to see how much work that is, do you foresee 0.9.0 still going out in the next week or so @garyp ?

garyp added a commit that referenced this issue May 17, 2020
Also some minor cleanup of the `build.gradle.kts` files.

Fixes #35.
@garyp garyp closed this as completed in #42 May 17, 2020
@garyp
Copy link
Collaborator

garyp commented May 17, 2020

@tinder-aminghadersohi I belatedly realized that updating the Kotlin version is a small change and we don't need to wait for the large set of Kotlin/Native changes to go in. I've updated the versions on master and will try to get a new release out soon. Just need to do some quick testing of the JSON serialization to make sure nothing broke with the update to 0.20.0.

@tinder-aminghadersohi
Copy link
Contributor

Thanks! Unfortunately, we were forced to remove the usage of the JSON serialization. But I am looking forward to the next version of the library either way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants