glassfy / glassfy-flutter

Open source SDK to quickly integrate subscriptions, stop worring about code maintenance, and getting advanced real-time data. Javascript / iOS glue framework
MIT License
21 stars 4 forks source link

Error While Getting APK in Release Mode #17

Closed berkaycatak closed 7 months ago

berkaycatak commented 8 months ago

Hello, I'm trying to create an apk to publish my app on the store (flutter build appbundle --release) but I'm encountering the following error. I've been searching the internet for hours but I couldn't find any solution. I determined that the error was caused by this package. I'm waiting for your help.

flutter build appbundle --release
Font asset "MaterialIcons-Regular.otf" was tree-shaken, reducing it from 1645184 to 2372 bytes (99.9% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
Font asset "CupertinoIcons.ttf" was tree-shaken, reducing it from 283452 to 912 bytes (99.7% reduction). Tree-shaking can be disabled by providing the --no-tree-shake-icons flag when building your app.
ERROR:/Users/berkaycatak/.gradle/caches/transforms-3/a2df2b8f56f6acef2d97cb1b5649225c/transformed/jetified-moshi-1.15.0.jar: R8: com.android.tools.r8.internal.YI0: Records are not supported

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/berkaycatak/.gradle/caches/transforms-3/a2df2b8f56f6acef2d97cb1b5649225c/transformed/jetified-moshi-1.15.0.jar:META-INF/versions/16/com/squareup/moshi/RecordJsonAdapter$ComponentBinding.class

* 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

BUİLD FAILED in 45s
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.13.2, on macOS 13.0.1 22A400 darwin-arm64, locale tr-TR)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.82.3)
[✓] Connected device (3 available)
[✓] Network resources

• No issues found!

The example application you published on github does not open.

flutter run --release
Using hardware rendering with device sdk gphone64 arm64. If you notice graphics
artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on sdk gphone64 arm64 in release mode...
e: /Users/berkaycatak/Downloads/glassfy-flutter-main/example/build/glassfy_flutter/.transforms/980729ad37f2aa289c82178f3688017b/transformed/out/jars/classes.jar!/META-INF/glassfy_flutter_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/6379987409d83f1203181eae1340640d/transformed/lifecycle-livedata-2.6.1/jars/classes.jar!/META-INF/lifecycle-livedata_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/03d9ace324c457540a61bfb31f43a0c0/transformed/lifecycle-viewmodel-2.6.1/jars/classes.jar!/META-INF/lifecycle-viewmodel_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/6f58c91662e0eb02fa616ff5733f83a7/transformed/lifecycle-livedata-core-2.6.1/jars/classes.jar!/META-INF/lifecycle-livedata-core_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/102b4694cb7df2ba15bc8706ec186ce9/transformed/jetified-lifecycle-viewmodel-savedstate-2.6.1/jars/classes.jar!/META-INF/lifecycle-viewmodel-savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/74e31430c2908bd355659665178b75fd/transformed/lifecycle-runtime-2.6.1/jars/classes.jar!/META-INF/lifecycle-runtime_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/modules-2/files-2.1/androidx.lifecycle/lifecycle-common/2.6.1/10f354fdb64868baecd67128560c5a0d6312c495/lifecycle-common-2.6.1.jar!/META-INF/lifecycle-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/transforms-3/7b74ebc2eec7a152f5b3af52e64c312b/transformed/jetified-savedstate-1.2.1/jars/classes.jar!/META-INF/savedstate_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.8.21/43d50ab85bc7587adfe3dda3dbe579e5f8d51265/kotlin-stdlib-1.8.21.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
e: /Users/berkaycatak/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.8.21/d749cd5ae25da36d06e5028785038e24f9d37976/kotlin-stdlib-common-1.8.21.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.5.1.
ERROR:/Users/berkaycatak/.gradle/caches/transforms-3/c7073e55adcebe80fd8f46d7ff6b5c20/transformed/jetified-moshi-1.15.0.jar: R8: com.android.tools.r8.internal.YI0: Records are not supported

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/berkaycatak/.gradle/caches/transforms-3/c7073e55adcebe80fd8f46d7ff6b5c20/transformed/jetified-moshi-1.15.0.jar:META-INF/versions/16/com/squareup/moshi/RecordJsonAdapter$ComponentBinding.class

* 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

BUİLD FAILED in 58s
Running Gradle task 'assembleRelease'...                           58,9s

┌─ Flutter Fix ────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin.       │
│ Find the latest version on                                                   │
│ https://kotlinlang.org/docs/releases.html#release-details, then update       │
│ /Users/berkaycatak/Downloads/glassfy-flutter-main/example/android/build.grad │
│ le:                                                                          │
│ ext.kotlin_version = '<latest-version>'                                      │
└──────────────────────────────────────────────────────────────────────────────┘
Exception: Gradle task assembleRelease 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:551:7)
<asynchronous suspension>
#2      AndroidGradleBuilder.buildApk
(package:flutter_tools/src/android/gradle.dart:242:5)
<asynchronous suspension>
#3      AndroidDevice.startApp
(package:flutter_tools/src/android/android_device.dart:578:7)
<asynchronous suspension>
#4      FlutterDevice.runCold
(package:flutter_tools/src/resident_runner.dart:534:33)
<asynchronous suspension>
#5      ColdRunner.run (package:flutter_tools/src/run_cold.dart:57:28)
<asynchronous suspension>
#6      RunCommand.runCommand
(package:flutter_tools/src/commands/run.dart:753:27)
<asynchronous suspension>
#7      FlutterCommand.run.<anonymous closure>
(package:flutter_tools/src/runner/flutter_command.dart:1297:27)
<asynchronous suspension>
#8      AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150: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:339:9)
<asynchronous suspension>
#11     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#12     FlutterCommandRunner.runCommand
(package:flutter_tools/src/runner/flutter_command_runner.dart:285:5)
<asynchronous suspension>
#13     run.<anonymous closure>.<anonymous closure>
(package:flutter_tools/runner.dart:115:9)
<asynchronous suspension>
#14     AppContext.run.<anonymous closure>
(package:flutter_tools/src/base/context.dart:150:19)
<asynchronous suspension>
#15     main (package:flutter_tools/executable.dart:90:3)
<asynchronous suspension>

iOS:

Launching lib/main.dart on iPhone 14 Pro in debug mode...
Running pod install...                                             18,5s
Running Xcode build...                                                  
Xcode build done.                                           18,0s
Failed to build iOS app
Error (Xcode): Undefined symbol: _OBJC_CLASS_$_Glassfy

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 14 Pro.
berkaycatak commented 8 months ago

@marcopifferi @lgarbo

marcopifferi commented 8 months ago

We are not able to reproduce the problem. Why you belive the problem is connected with Glassfy ? Can you please send a small sample app that reproduce the issue ?