Skip to content

fix: build issue for android #2326

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

Open
wants to merge 5 commits into
base: special/6.2.6-sp.426158
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 50 additions & 41 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
# Create a zip file of the DartDoc output
zip -r agora_rtc_engine_docs.zip doc
- name: Upload DartDoc Artifact ⬆️
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: agora_rtc_engine_docs.zip
path: agora_rtc_engine_docs.zip
Expand All @@ -85,20 +85,25 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
version: ["3.7.0", "3.24.5"]
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
steps:
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
- uses: actions/checkout@v3
- uses: actions/setup-java@v4
with:
java-version: "11"
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.version }}
- run: flutter config --enable-macos-desktop
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: run flutter android integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -115,8 +120,8 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.16"]
runs-on: macos-12
version: ["3.7.0", "3.24.5"]
runs-on: macos-latest
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
Expand All @@ -126,18 +131,18 @@ jobs:
with:
flutter-version: ${{ matrix.version }}
cache: true
- uses: futureware-tech/simulator-action@v1
- uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 13 Pro Max'
model: 'iPhone 15'
- run: bash ci/run_flutter_integration_test_ios.sh

integration_test_macos:
name: Run Flutter macOS Integration Tests
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
runs-on: macos-12
version: ["3.7.0", "3.24.5"]
runs-on: macos-latest
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
Expand All @@ -155,7 +160,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
version: ["3.7.0", "3.24.5"]
runs-on: windows-2019
timeout-minutes: 120
env:
Expand All @@ -177,7 +182,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ['3.x']
version: ['3.24.5']
runs-on: ubuntu-latest
timeout-minutes: 60
env:
Expand All @@ -200,13 +205,14 @@ jobs:
needs: flutter_codestyle_check
strategy:
matrix:
version: ["3.7.0", "3.x"]
version: ["3.7.12", "3.24.5"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: "11"
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.version }}
Expand All @@ -220,13 +226,14 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
version: ["3.7.12", "3.24.5"]
runs-on: windows-2019
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.version }}
Expand All @@ -241,8 +248,8 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
runs-on: macos-12
version: ["3.7.0", "3.24.5"]
runs-on: macos-latest
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
Expand All @@ -261,7 +268,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ['3.x']
version: ['3.24.5']
runs-on: macos-13
timeout-minutes: 120
steps:
Expand All @@ -286,7 +293,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.7.0", "3.x"]
version: ["3.7.0", "3.24.5"]
runs-on: ubuntu-latest
timeout-minutes: 120
steps:
Expand All @@ -304,18 +311,19 @@ jobs:
rendering_test_android:
name: Run Flutter Android Rendering Tests
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
runs-on: macos-12
runs-on: ubuntu-latest
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
- uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'zulu'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.x'
flutter-version: '3.24.5'
cache: true
- name: Checkout hoe
uses: actions/checkout@v3
Expand All @@ -342,7 +350,11 @@ jobs:
--flutter-package-name=agora_rtc_engine \
--iris-android-cdn-url=${IRIS_CDN_URL_ANDROID} \
--iris-macos-cdn-url=${IRIS_CDN_URL_MACOS}
- run: flutter config --enable-macos-desktop
- name: Enable KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- name: run flutter android integration tests
uses: reactivecircus/android-emulator-runner@v2
with:
Expand All @@ -359,13 +371,13 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ["3.x"]
version: ["3.24.5"]
runs-on: macos-13 # Rendering test on ios simulator need macos 13+
timeout-minutes: 60
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ matrix.version }}
Expand All @@ -391,21 +403,18 @@ jobs:
--apple-package-name=io.agora.agoraRtcEngineExample \
--flutter-package-name=agora_rtc_engine \
--iris-ios-cdn-url=${IRIS_CDN_URL_IOS}
- name: Create ios simulator
run: |
xcrun simctl list
# We generate the screenshots base on the simulator "iPhone 13 Pro Max", so we set the SimDeviceType to iPhone 13 Pro Max.
# If you need to change the SimDeviceType, you may need to re-generate the screenshots first.
xcrun simctl create Flutter-iPhone com.apple.CoreSimulator.SimDeviceType.iPhone-13-Pro-Max com.apple.CoreSimulator.SimRuntime.iOS-16-4 | xargs xcrun simctl boot
- uses: futureware-tech/simulator-action@v3
with:
model: 'iPhone 15'
- run: bash ci/rendering_test_ios.sh

rendering_test_macos:
name: Run Flutter macOS Rendering Tests
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ['3.x']
runs-on: macos-12
version: ['3.24.5']
runs-on: macos-latest
timeout-minutes: 120
env:
TEST_APP_ID: ${{ secrets.MY_APP_ID }}
Expand Down Expand Up @@ -499,7 +508,7 @@ jobs:
if: ${{ !contains(github.event.pull_request.labels.*.name, 'ci:skip') }}
strategy:
matrix:
version: ['3.x']
version: ['3.24.5']
runs-on: ubuntu-latest
timeout-minutes: 60
env:
Expand All @@ -518,7 +527,7 @@ jobs:
chromedriver --port=4444 --trace-buffer-size=100000 &
bash ci/run_rendering_test.sh web

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
if: failure()
with:
name: debug-golden-files
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ android {
compileSdkVersion safeExtGet('compileSdkVersion', 31)

defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 16)
minSdkVersion safeExtGet('minSdkVersion', 21)

consumerProguardFiles 'consumer-rules.pro'
}
Expand All @@ -57,8 +57,8 @@ dependencies {
if (isDev(project)) {
implementation fileTree(dir: "libs", include: ["*.jar"])
} else {
api 'io.agora.rtc:iris-rtc:4.2.6.147-build.1'
api 'io.agora.rtc:agora-special-full:4.2.6.147.BASIC'
api 'io.agora.rtc:iris-rtc:4.2.6.163-test.1'
api 'io.agora.rtc:agora-special-full:4.2.6.163.TEST1'
}
}

Expand Down
2 changes: 2 additions & 0 deletions android/consumer-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
-keep class org.jetbrains.** { *; }

-keep class io.agora.**{*;}
# Suppress ERROR: R8: Missing class com.google.devtools.build.android.desugar.runtime.ThrowableExtension
-dontwarn com.google.devtools.build.android.desugar.runtime.ThrowableExtension
4 changes: 3 additions & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
namespace "io.agora.agora_rtc_ng_example"

compileSdkVersion 34

compileOptions {
Expand All @@ -44,7 +46,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "io.agora.agora_rtc_ng_example"
minSdkVersion 18
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
4 changes: 2 additions & 2 deletions example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
buildscript {
// Min kotlin version for Flutter SDK 3.24
ext.kotlin_version = '1.7.0'
ext.kotlin_version = '1.9.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:8.7.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand Down
2 changes: 1 addition & 1 deletion example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-all.zip

4 changes: 2 additions & 2 deletions ios/agora_rtc_engine.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Pod::Spec.new do |s|
puts '[plugin_dev] Found .plugin_dev file, use vendored_frameworks instead.'
s.vendored_frameworks = 'libs/*.xcframework'
else
s.dependency 'AgoraIrisRTC_iOS', '4.2.6.147-build.1'
s.dependency 'AgoraRtcEngine_Special_iOS', '4.2.6.147.BASIC'
s.dependency 'AgoraIrisRTC_iOS', '4.2.6.163-test.1'
s.dependency 'AgoraRtcEngine_Special_iOS', '4.2.6.163.TEST1'
end

s.platform = :ios, '9.0'
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: agora_rtc_engine
description: >-
Flutter plugin of Agora RTC SDK, allow you to simply integrate Agora Video
Calling or Live Video Streaming to your app with just a few lines of code.
version: 6.2.6-sp.426163.b.1
version: 6.2.6-sp.426163.test.1
homepage: https://www.agora.io
repository: https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/tree/main
environment:
Expand All @@ -17,7 +17,7 @@ dependencies:
ffi: '>=1.1.2'
async: ^2.8.2
meta: ^1.7.0
iris_method_channel: 2.0.0
iris_method_channel: '>=2.2.0'
js: '>=0.6.3'
dev_dependencies:
flutter_test:
Expand Down
2 changes: 1 addition & 1 deletion test_shard/fake_test_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
applicationId "com.example.fake_test_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion test_shard/integration_test_app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {
applicationId "io.agora.integration_test_app.integration_test_app"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
4 changes: 2 additions & 2 deletions test_shard/integration_test_app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
buildscript {
// Min kotlin version for Flutter SDK 3.24
ext.kotlin_version = '1.7.0'
ext.kotlin_version = '1.9.10'
repositories {
google()
mavenCentral()
Expand All @@ -27,6 +27,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion test_shard/rendering_test/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
applicationId "com.example.rendering_test"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
minSdkVersion flutter.minSdkVersion
minSdkVersion 21
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Loading