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

Not working with Android SDK 28 #42

Closed
Vardiak opened this issue Jul 11, 2019 · 10 comments
Closed

Not working with Android SDK 28 #42

Vardiak opened this issue Jul 11, 2019 · 10 comments
Assignees

Comments

@Vardiak
Copy link
Contributor

Vardiak commented Jul 11, 2019

Describe the bug
When I try to use this package with Android SDK 28, I get spammed with "web socket error" in the debug console and the socket can't connect. After multiple hours of work trying to merge my application with the example I found out that it worked by replacing compileSdkVersion and targetSdkVersion from 28 to 27 in android/app/build.gradle.

To Reproduce
Update the example to Android SDK 28

Expected behavior
The socket should connect normally.

@tiholic
Copy link
Contributor

tiholic commented Jul 12, 2019

@Vardiak is this resolved by upgrading to latest 0.2.0?

@adlerluiz
Copy link

adlerluiz commented Jul 17, 2019

Here is the same, both 28 and 29

pubspec.lock

adhara_socket_io:
    dependency: "direct main"
    description:
      name: adhara_socket_io
      url: "https://pub.dartlang.org"
    source: hosted
    version: "0.2.0"

build.gradle

android {
    compileSdkVersion 28

    defaultConfig {
        minSdkVersion 21
        targetSdkVersion 28

@GMasciaRDT
Copy link

GMasciaRDT commented Jul 20, 2019

I had the same problem and I fixed it by adding the following line in the AndroidManifest.xml file inside "application":

android:usesCleartextTraffic="true"

For more info: https://stackoverflow.com/questions/53284903/socket-io-not-working-on-android-9-api-level-28)

Hope this helps.

@adlerluiz
Copy link

adlerluiz commented Jul 20, 2019

@GMasciaRDT Thank You, I added and it worked.

image

@tiholic
Copy link
Contributor

tiholic commented Aug 10, 2019

Thank you @GMasciaRDT
Project README updated with the necessary help content

@tiholic tiholic closed this as completed Aug 10, 2019
@karnitsan
Copy link

thanks! it works.

@breitembach
Copy link

breitembach commented May 6, 2020

FAILURE: Build failed with an exception.                                
                                                                        
* What went wrong:                                                      
Execution failed for task ':adhara_socket_io:verifyReleaseResources'.   
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  /build/adhara_socket_io/intermediates/res/merged/release/values/values.xml:236: error: resource android:attr/fontVariationSettings not found.
  /home/build/adhara_socket_io/intermediates/res/merged/release/values/values.xml:237: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

@Nadeembhat
Copy link

I had the same problem and I fixed it by adding the following line in the AndroidManifest.xml file inside "application":

android:usesCleartextTraffic="true"

For more info: https://stackoverflow.com/questions/53284903/socket-io-not-working-on-android-9-api-level-28)

Hope this helps.

i used these attributes , but its not working giving me same error
io.socket.engineio.client.EngineIOException: websocket error

@MohammedErbia
Copy link

android:usesCleartextTraffic="true"
i used these attributes , but its not working giving me same error

The plugins adhara_socket_io, flutter_absolute_path, onesignal_flutter use a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if these plugins support the Android V2 embedding. Otherwise, consider removing them since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Failed to create parent directory '/Users/basel' when creating directory '/Users/basel/AndroidStudioProjects/estiqbal/android/app/build/intermediates/flutter/debug/flutter_assets'

  • 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 33s
Exception: Gradle task assembleDebug failed with exit code 1

@sercangoger
Copy link

android native for This error has resurfaced. i am getting the same error. I did all the trials. but still the same

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants