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

Flutter application getting error after adding apptics_flutter package to the project. #5

Open
khan-raptee opened this issue Jul 10, 2024 · 6 comments

Comments

@khan-raptee
Copy link

I am using zoho apptics for flutter my application. I have configured the android plugin and if i run the app it is working fine.To use zoho apptics from my flutter app i should add apptics_flutter package. But when i add the apptics_flutter to my project it starts crashing. Below i have attached the images of how my app works before adding package and after adding the package. please provide solution for this.
apptics 1
apptics 2

@xtyuo04
Copy link

xtyuo04 commented Jul 10, 2024

@khan-raptee - Thanks for contacting Apptics support!

Updating the JAVA version to 17 and Kotlin to 1.8.0 will resolve this issue.

Do let me know if you need any further assistance from our end.

@khan-raptee
Copy link
Author

khan-raptee commented Jul 10, 2024

I have updated kotlin to 1.8.0

I have already JAVA 20 below you can check

java --version
java 20.0.1 2023-04-18
Java(TM) SE Runtime Environment (build 20.0.1+9-29)
Java HotSpot(TM) 64-Bit Server VM (build 20.0.1+9-29, mixed mode, sharing)

My android/build.gradle file >>

buildscript {
    ext.kotlin_version = '1.8.0'
    repositories {
        google()
        mavenCentral()
        maven {
            url uri('libs')
        }
        maven {
            url "https://maven.zohodl.com/"
        }
    }
    dependencies {
        classpath "com.zoho.apptics:apptics-plugin:0.1.2"
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

Still i am getting the same issue

>> 
C:\Users\zoho_apptics_temp>flutter run
Launching lib\main.dart on 22081283G in debug mode...
1111

{"result":"success"}
com.android.tools.r8.internal.Hc: Sealed classes are not supported as program classes

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform apptics-core-0.2.5.aar (com.zoho.apptics:apptics-core:0.2.5) to match attributes {artifactType=android-dex, asm-transformed-variant=NONE, dexing-enable-desugaring=true, dexing-enable-jacoco-instrumentation=false, dexing-is-debuggable=true, dexing-min-sdk=23, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.libraryelements=aar, org.gradle.status=release, org.gradle.usage=java-runtime}.
      > Execution failed for DexingWithClasspathTransform: C:\jetified-apptics-core-0.2.5-runtime.jar.
         > Error while dexing.

* 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 1m 25s
Running Gradle task 'assembleDebug'...                             87.0s

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
│ To disable the shrinker, pass the `--no-shrink` flag to this command.      │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │

┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
┌─ Flutter Fix ──────────────────────────────────────────────────────────────┐
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
│ [!] The shrinker may have failed to optimize the Java bytecode.            │
│ To disable the shrinker, pass the `--no-shrink` flag to this command.      │
│ To disable the shrinker, pass the `--no-shrink` flag to this command.      │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
│ To learn more, see: https://developer.android.com/studio/build/shrink-code │
└────────────────────────────────────────────────────────────────────────────┘
└────────────────────────────────────────────────────────────────────────────┘
Error: Gradle task assembleDebug failed with exit code 1
Error: Gradle task assembleDebug failed with exit code 1

C:\Users\Kashaf\Desktop\zoho_apptics_temp>

@xtyuo04
Copy link

xtyuo04 commented Jul 10, 2024

@khan-raptee - I will share a sample project. Also would request you to please remove the logs as it is exposing some identifiers.

@khan-raptee
Copy link
Author

Thanks. Please share the project
One more thing is apptics_flutter pub package you've mentioned version 0.1.2

classpath 'com.zoho.apptics:apptics-plugin:0.1.2'

but sometimes in log section we get error to get version 0.2.5

apptics-core-0.2.5

@xtyuo04
Copy link

xtyuo04 commented Jul 10, 2024

flutter-sdk-sample.zip
Here is a sample project.. @khan-raptee
All you need to do is include your apptics-config.json file in the app directory.

Thanks. Please share the project One more thing is apptics_flutter pub package you've mentioned version 0.1.2

classpath 'com.zoho.apptics:apptics-plugin:0.1.2'

but sometimes in log section we get error to get version 0.2.5

apptics-core-0.2.5

Also, for the above, it is intended behavior

@khan-raptee
Copy link
Author

khan-raptee commented Jul 11, 2024

  • Thanks it works for JAVA 17 and kotlin 1.8.0 but, what if i need version for kotlin above 1.8.0 or below 1.8.0 and java below 17 or above 17 , will it works .

  • second is some pub packages require JAVA 1.8 , it does not support JAVA 17 which I have defined as to run ZOHO apptics SDK.

  • below is such an example i am trying to run my app after adding flutter_contacts pub package to pubspec.yaml.

>flutter run
Launching lib\main.dart on 22081283G in debug mode...

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':flutter_contacts:compileDebugKotlin'.
> 'compileDebugJavaWithJavac' task (current target is 1.8) and 'compileDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain


* 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 1m 43s
Running Gradle task 'assembleDebug'...                            105.6s
Error: Gradle task assembleDebug failed with exit code 1
  • please provide solution for this issue.

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

2 participants