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

Avoid depending on reference equality of interned strings and literals; this seems to fail sometimes on Android #367

Merged
merged 2 commits into from
Mar 1, 2018

Conversation

paddybyers
Copy link
Member

No description provided.

Copy link

@robholmes robholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirm that this fixes the issue on Samsung tablet causing null Message.name.

@@ -173,7 +173,7 @@ public JsonElement serialize(BaseMessage message, Type typeOfMessage, JsonSerial
if(message.clientId != null) json.addProperty("clientId", message.clientId);
if(message.connectionId != null) json.addProperty("connectionId", message.connectionId);
return json;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these due to a change of IDE?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sort of - I saw those as I was looking through the code last night and fixed them. So they were explicit changes, but I noticed them because of a change of IDE.

@paddybyers paddybyers changed the base branch from master to develop March 1, 2018 15:39
@paddybyers paddybyers merged commit adc2b1b into develop Mar 1, 2018
@paddybyers
Copy link
Member Author

@robholmes This update is in https://bintray.com/ably-io/ably/ably-android/1.0.2

Can you give it a try please?

@robholmes
Copy link

robholmes commented Mar 1, 2018

@paddybyers Android Studio is telling me there is an update to 1.0.2, but upon changing the gradle compile to compile 'io.ably:ably-android:1.0.2' I get the below error, and it does look like the file doesn't exist with that name in https://bintray.com/ably-io/ably/ably-android/1.0.2#files/io%2Fably%2Fably-android%2F1.0.2

Though there is a file named ably-android-1.0.2-release.aar so maybe something has changed in the release process? (not sure as I've never released to bintray)

Error:Could not find ably-android.jar (io.ably:ably-android:1.0.2).
Searched in the following locations:
    https://jcenter.bintray.com/io/ably/ably-android/1.0.2/ably-android-1.0.2.jar

@paddybyers
Copy link
Member Author

@robholmes there's never been an android .jar.

For 1.0.1 there was an ably-android-1.0.1.aar which is probably what you were using. Now there are separate release and debug .aars.

I did upgrade the toolchain versions (gradle and Android plugins) and that seems to have messed things up. I'm going to rename the -release file and re-upload until I work out what's up.

@paddybyers
Copy link
Member Author

@robholmes

I'm going to rename the -release file and re-upload until I work out what's up.

Can you retry now?

@robholmes
Copy link

robholmes commented Mar 1, 2018

@paddybyers unfortunately still no luck. It's not actually me that's requiring a .jar, that's just what Android Studio is looking for when using the compile 'io.ably:ably-android:1.0.2' in my gradle file. The only thing changed from 1.0.1 (which does download correctly from bintray) is changing the last digit to a 2.

@paddybyers
Copy link
Member Author

Hmm. I tried the sample project (https://github.com/funkyboy/AblyJavaTest) and updated the ref to 1.0.2 and it built ok.

I also tried updating the ref to 1.0.3 and I got:

Information:Gradle tasks [:app:assembleDebug]
Error:Could not resolve all files for configuration ':app:debugCompileClasspath'.
> Could not find io.ably:ably-android:1.0.3.
  Searched in the following locations:
      file:/Users/paddy/Library/Android/sdk/extras/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      file:/Users/paddy/Library/Android/sdk/extras/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
      file:/Users/paddy/Library/Android/sdk/extras/google/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      file:/Users/paddy/Library/Android/sdk/extras/google/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
      file:/Users/paddy/Library/Android/sdk/extras/android/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      file:/Users/paddy/Library/Android/sdk/extras/android/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      file:/Applications/Android Studio.app/Contents/gradle/m2repository/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
      https://dl.google.com/dl/android/maven2/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      https://dl.google.com/dl/android/maven2/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
      https://jcenter.bintray.com/io/ably/ably-android/1.0.3/ably-android-1.0.3.pom
      https://jcenter.bintray.com/io/ably/ably-android/1.0.3/ably-android-1.0.3.jar
  Required by:
      project :app
Information:BUILD FAILED in 1s
Information:1 error
Information:0 warnings
Information:See complete output in console

This is in Android Studio. It does seem to be looking for all possible variants. I can't see any difference in the metadata between 1.0.1 and 1.0.2 on Bintray.

Does it help to clean the project?

@funkyboy
Copy link
Contributor

funkyboy commented Mar 2, 2018

@robholmes I can confirm what @paddybyers said. The master branch of this project works when using compile 'io.ably:ably-android:1.0.2'.

Maybe there's some special setting in your build file? Here's what I have been testing (except using version 1.0.2 of Ably SDK).

@paddybyers
Copy link
Member Author

@robholmes any update on this from your end?

@KacperKluka KacperKluka deleted the fix-intern-failure branch March 25, 2022 09:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants