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

Can't build app in profile mode #91

Open
a7mdragab1 opened this issue Oct 9, 2024 · 15 comments
Open

Can't build app in profile mode #91

a7mdragab1 opened this issue Oct 9, 2024 · 15 comments

Comments

@a7mdragab1
Copy link

a7mdragab1 commented Oct 9, 2024

Dears,
I am not able to build app in profile mode though it is working in debug and release.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':jitsi_meet_flutter_sdk:generateProfileRFile'.
> Could not resolve all files for configuration ':jitsi_meet_flutter_sdk:profileCompileClasspath'.
   > Could not resolve com.facebook.react:react-android:0.72.9.
     Required by:
         project :jitsi_meet_flutter_sdk > org.jitsi.react:jitsi-meet-sdk:9.2.2
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-amplitude:2.7.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-giphy:2.3.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-google-signin:10.1.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-async-storage:1.19.4-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-background-timer:2.4.1-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-calendar-events:2.2.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-community_clipboard:1.5.1-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-community_netinfo:11.1.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-default-preference:1.4.4-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-device-info:10.9.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-gesture-handler:2.9.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-get-random-values:1.9.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-immersive-mode:2.0.1-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-keep-awake:4.0.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-orientation-locker:1.6.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-pager-view:6.2.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-performance:5.0.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-safe-area-context:4.7.1-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-screens:3.24.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-slider:4.4.3-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-sound:0.11.2-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-splash-screen:3.3.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-svg:13.13.0-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-video:6.0.0-alpha.11-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-webrtc:118.0.7-jitsi-16757212
         project :jitsi_meet_flutter_sdk > com.facebook.react:react-native-webview:13.5.1-jitsi-16757212
      > No matching variant of com.facebook.react:react-android:0.72.9 was found. The consumer was configured to find a library for use during compile-time
, preferably optimized for Android, as well as attribute 'com.android.build.api.attributes.AgpVersionAttr' with value '8.7.0', attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile', attribute 'org.jetbrains.kotlin.platform.type' with value 'androidJvm' but:
          - Variant 'debugVariantDefaultApiPublication' declares a library for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugVariantDefaultRuntimePublication' declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'debugVariantDefaultSourcePublication' declares a component for use during runtime:
              - Incompatible because this component declares documentation, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug' and the consumer needed a library, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantDefaultApiPublication' declares a library for use during compile-time:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantDefaultRuntimePublication' declares a library for use during runtime:
              - Incompatible because this component declares a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')
          - Variant 'releaseVariantDefaultSourcePublication' declares a component for use during runtime:
              - Incompatible because this component declares documentation, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'release' and the consumer needed a library, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'profile'
              - Other compatible attributes:
                  - Doesn't say anything about com.android.build.api.attributes.AgpVersionAttr (required '8.7.0')
                  - Doesn't say anything about its target Java environment (preferred optimized for Android)
                  - Doesn't say anything about org.jetbrains.kotlin.platform.type (required 'androidJvm')

* Try:
> No matching variant errors are explained in more detail at https://docs.gradle.org/8.10.2/userguide/variant_model.html#sub:variant-no-match.
> Review the variant matching algorithm at https://docs.gradle.org/8.10.2/userguide/variant_attributes.html#sec:abm_algorithm.
> 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 58s
Running Gradle task 'assembleProfile'...                           59.3s
Error: Gradle task assembleProfile failed with exit code 1
#0      throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1      AndroidGradleBuilder.buildGradleApp (package:flutter_tools/src/android/gradle.dart:497:9)
<asynchronous suspension>
#2      AndroidGradleBuilder.buildApk (package:flutter_tools/src/android/gradle.dart:220:5)
<asynchronous suspension>
#3      AndroidDevice.startApp (package:flutter_tools/src/android/android_device.dart:584:7)
<asynchronous suspension>
#4      FlutterDevice.runCold (package:flutter_tools/src/resident_runner.dart:525:33)
<asynchronous suspension>
#5      ColdRunner.run (package:flutter_tools/src/run_cold.dart:53:28)
<asynchronous suspension>
#6      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:850:27)
<asynchronous suspension>
#7      FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:1450:27)
<asynchronous suspension>
#8      AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#9      CommandRunner.runCommand (package:args/command_runner.dart:212:13)
<asynchronous suspension>
#10     FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:421:9)
<asynchronous suspension>
#11     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#12     FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:364:5)
<asynchronous suspension>
#13     run.<anonymous closure>.<anonymous closure> (package:flutter_tools/runner.dart:130:9)
<asynchronous suspension>
#14     AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:19)
<asynchronous suspension>
#15     main (package:flutter_tools/executable.dart:94:3)
<asynchronous suspension>
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, 3.26.0-0.1.pre, on Microsoft Windows [Version 10.0.22631.4169], locale en-US)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.10.4)
[√] Android Studio (version 2024.2)
[√] VS Code (version 1.94.0)
[√] Connected device (6 available)
[√] Network resources

• No issues found!
plugins{
    id "com.android.application" version "8.7.0" apply false
    id "org.jetbrains.kotlin.android" version "2.0.20" apply false
}
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
compileSdk = 35
ndkVersion = "27.0.12077973"

compileOptions {
        coreLibraryDesugaringEnabled  = true
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }

    kotlinOptions {
        jvmTarget = JavaVersion.VERSION_1_8
    }
@saghul
Copy link
Member

saghul commented Oct 9, 2024

We don't seem to support running in profile mode, though we haven't been able to figure out why :-/

@a7mdragab1
Copy link
Author

Is there any workaround?

@saghul
Copy link
Member

saghul commented Oct 9, 2024

Not that I know of, sorry.

@a7mdragab1
Copy link
Author

a7mdragab1 commented Oct 9, 2024

Finally, after some debugging, I found the solution

Change the plugin build.gradle to this

implementation ('org.jitsi.react:jitsi-meet-sdk:10.2.1') {
        exclude group: 'com.facebook.react', module: 'react-android'
        transitive = true
    }
    implementation("com.facebook.react:react-android:0.76.0-rc.4") {
        attributes {
            attribute(Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String), "release")
        }
    }

and in app proguard

-dontwarn com.facebook.imagepipeline.nativecode.WebpTranscoder

the version 0.76.0-rc.4 is the latest. You can change it as you need. but this is working.
Confirm and close this.

@a7mdragab1
Copy link
Author

Please I want to know how to solve this to be able to upgrade

External screen not removed

@saghul
Copy link
Member

saghul commented Oct 9, 2024

Sorry but that's a bad idea. Our SDK relies on a specific React Native SDK. If you change that then things might break in unexpected ways.

@a7mdragab1
Copy link
Author

Sorry but that's a bad idea. Our SDK relies on a specific React Native SDK. If you change that then things might break in unexpected ways.

You are right.
I found that the app crashes when start meeting
So, I put the version required by the org.jitsi.react:jitsi-meet-sdk:10.2.1 which is com.facebook.react:react-android:0.73.8 and it worked

So, it will be better using the required version with defining this attribute for it

Last edit

implementation ('org.jitsi.react:jitsi-meet-sdk:10.2.1') {
        exclude group: 'com.facebook.react', module: 'react-android'
        transitive = true
    }
    implementation("com.facebook.react:react-android:0.73.8") {
        attributes {
            attribute(Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String), "release") 
        }
    }

@saghul
Copy link
Member

saghul commented Oct 9, 2024

Great to know!🙏

@a7mdragab1
Copy link
Author

Great to know!🙏

Will be integrated in next versions?

@saghul
Copy link
Member

saghul commented Oct 10, 2024

If it's supported out of the box in RN then we'll pick it up when we upgrade, yes.

@saibotma
Copy link

@a7mdragab1 I think this issue should not be closed, as it has not been fixed yet.

@saghul
Copy link
Member

saghul commented Nov 14, 2024

We cannot fix it, it's a React Native thing and will be fixed with an update.

@a7mdragab1
Copy link
Author

@a7mdragab1 I think this issue should not be closed, as it has not been fixed yet.

You can use this solution

You are right.
I found that the app crashes when start meeting
So, I put the version required by the org.jitsi.react:jitsi-meet-sdk:10.2.1 which is com.facebook.react:react-android:0.73.8 and it worked

So, it will be better using the required version with defining this attribute for it

Last edit

implementation ('org.jitsi.react:jitsi-meet-sdk:10.2.1') {
        exclude group: 'com.facebook.react', module: 'react-android'
        transitive = true
    }
    implementation("com.facebook.react:react-android:0.73.8") {
        attributes {
            attribute(Attribute.of("com.android.build.api.attributes.BuildTypeAttr", String), "release") 
        }
    }

@saibotma
Copy link

We cannot fix it, it's a React Native thing and will be fixed with an update.

I mean this kindly: This is precisely why I suggest keeping this issue open. As an “end user,” I don’t particularly care whether this Flutter package uses React behind the scenes; I only care about whether it works or not.

@saghul
Copy link
Member

saghul commented Nov 15, 2024

Fair enough.

@saghul saghul reopened this Nov 15, 2024
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

3 participants