cybex-dev / twilio_voice

Flutter Twilio Voice Plugin
https://twilio-voice-web.web.app/
MIT License
40 stars 85 forks source link

Android Error #250

Closed rhowelp closed 2 months ago

rhowelp commented 2 months ago

I am using twilio_voice: ^0.1.3 in flutter version 3.7.2 and i got this error, I also even tried to upgrade flutter version to 3.19.1 but I still got the same error

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > 2 issues were found when checking AAR metadata:

       1.  Dependency 'androidx.core:core-ktx:1.15.0-alpha02' requires libraries and applications that
           depend on it to compile against version 35 or later of the
           Android APIs.

           :app is currently compiled against android-34.

           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.

           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 35, then update this project to use
           compileSdkVerion of at least 35.

           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

       2.  Dependency 'androidx.core:core:1.15.0-alpha02' requires libraries and applications that
           depend on it to compile against version 35 or later of the
           Android APIs.

           :app is currently compiled against android-34.

           Also, the maximum recommended compile SDK version for Android Gradle
           plugin 7.4.2 is 33.

           Recommended action: Update this project's version of the Android Gradle
           plugin to one that supports 35, then update this project to use
           compileSdkVerion of at least 35.

           Note that updating a library or application's compileSdkVersion (which
           allows newer APIs to be used) can be done separately from updating
           targetSdkVersion (which opts the app in to new runtime behavior) and
           minSdkVersion (which determines which devices the app can be installed
           on).

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.

and from what I know android 35 is not yet stable but I still try to upgrade the compileSdkVersion to 35 and I got this error..

Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.res.LinkApplicationAndroidResourcesTask$TaskAction
   > Android resource linking failed
     aapt2.exe E 08-30 03:48:54 29404 29216 LoadedArsc.cpp:94] RES_TABLE_TYPE_TYPE entry offsets overlap actual entry data.
     aapt2.exe E 08-30 03:48:54 29404 29216 ApkAssets.cpp:149] Failed to load resources table in APK 'C:\Users\MyPC\AppData\Local\Android\sdk\platforms\android-35\android.jar'.
     error: failed to load include path C:\Users\MyPC\AppData\Local\Android\sdk\platforms\android-35\android.jar.

here is my flutter doctor

[√] Flutter (Channel stable, 3.7.2, on Microsoft Windows [Version 10.0.22631.3958], locale en-PH)
    • Flutter version 3.7.2 on channel stable at C:\dev\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 32fb2f948e (1 year, 7 months ago), 2023-02-08 07:30:10 -0800
    • Engine revision f40b73f8a4
    • Dart version 2.19.2
    • DevTools version 2.20.1

This is taking an unexpectedly long time...[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
    • Android SDK at C:\Users\MSIpc\AppData\Local\Android\sdk
    • Platform android-35, build-tools 35.0.0
    • Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2019 16.11.34)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools
    • Visual Studio Build Tools 2019 version 16.11.34601.136
    • Windows 10 SDK version 10.0.19041.0
    X The current Visual Studio installation is incomplete. Please reinstall Visual Studio.

[√] Android Studio (version 2023.2)
    • Android Studio at C:\Program Files\Android\Android Studio
    • Flutter plugin can be installed from:
       https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
       https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.9+0--11185874)

[√] VS Code (version 1.92.2)
    • VS Code at C:\Users\MyPC\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.94.0

[√] Connected device (4 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 15 (API 35) (emulator)
    • Windows (desktop)            • windows       • windows-x64    • Microsoft Windows [Version 10.0.22631.3958]
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 128.0.6613.85
    • Edge (web)                   • edge          • web-javascript • Microsoft Edge 128.0.2739.42

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 1 category.
rhowelp commented 2 months ago

I made it work by adding this in app/build.gradle

configurations.all {
    resolutionStrategy {
        force "androidx.core:core:1.13.1"
        force "androidx.core:core-ktx:1.13.1"
    }
}