invoiceninja / admin-portal

Invoice Ninja: Desktop/mobile admin portal built with Flutter
https://demo.invoiceninja.com
Other
1.6k stars 534 forks source link

F-Droid can't build #601

Closed licaon-kter closed 3 weeks ago

licaon-kter commented 11 months ago

ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/5350265884#L2127

But we have 3.7.6 as https://github.com/invoiceninja/admin-portal/blob/v5.0.127/.github/workflows/build.yml#L25 says, right?

Yet maybe the issue is that here it says something https://github.com/invoiceninja/admin-portal/blob/v5.0.127/pubspec.yaml#L9

and here it was not updated? https://github.com/invoiceninja/admin-portal/blob/v5.0.127/pubspec.foss.yaml#L9

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/d04c9a1b54e3cf899409bdf9b9edca9822d7049d

hillelcoren commented 11 months ago

I think there are two problems here:

I suggested to @linsui to use the Flutter version from here, I'll also update build.yml to the correct Flutter version.

hillelcoren commented 11 months ago

These changes have been made, let me know if you still have problems building.

licaon-kter commented 11 months ago

testing now, brb

licaon-kter commented 11 months ago
==== detail begin ====
/etc/bash.bashrc: line 7: PS1: unbound variable
++ pwd
+ export PUB_CACHE=/home/vagrant/build/com.invoiceninja.app/.pub-cache
+ PUB_CACHE=/home/vagrant/build/com.invoiceninja.app/.pub-cache
+ /home/vagrant/build/srclib/flutter/bin/flutter build apk
Downloading android-arm-profile/linux-x64 tools...               1,548ms
Downloading android-arm-release/linux-x64 tools...               1,039ms
Downloading android-arm64-profile/linux-x64 tools...             1,185ms
Downloading android-arm64-release/linux-x64 tools...             1,017ms
Downloading android-x64-profile/linux-x64 tools...               1,009ms
Downloading android-x64-release/linux-x64 tools...                 952ms

Upgrading build.gradle
Running Gradle task 'assembleRelease'...                        
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.9.10/dafaf2c27f27c09220cee312df10917d9a5d97ce/kotlin-stdlib-common-1.9.10.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.9.0, expected version is 1.7.1.
e: /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.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.9.0, expected version is 1.7.1.
e: /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.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.9.0, expected version is 1.7.1.
e: /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (32, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (34, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (34, 49): Unresolved reference: listOf
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (37, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (37, 49): Unresolved reference: listOf
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (40, 25): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (44, 21): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (55, 22): Unresolved reference: mutableListOf
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (56, 21): Unresolved reference: until
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (57, 47): Unresolved reference: let
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (58, 28): Unresolved reference: it
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (61, 20): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (63, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (67, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (68, 18): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (72, 16): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (76, 18): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (85, 17): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (86, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (87, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (97, 19): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class
e: /home/vagrant/build/com.invoiceninja.app/.pub-cache/hosted/pub.dev/desktop_drop-0.4.4/android/src/main/kotlin/one/mixin/desktop/drop/DesktopDropPlugin.kt: (98, 9): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /home/vagrant/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib/1.9.10/72812e8a368917ab5c0a5081b56915ffdfec93b7/kotlin-stdlib-1.9.10.jar!/kotlin/Unit.class

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':desktop_drop:compileReleaseKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
   > Compilation error. See log for more details

* 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 10m 31s
Running Gradle task 'assembleRelease'...                          633.0s

┌─ 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 /home/vagrant/build/com.invoiceninja.app/android/build.gradle:                      │
│ ext.kotlin_version = '<latest-version>'                                                    │
└────────────────────────────────────────────────────────────────────────────────────────────┘
Gradle task assembleRelease failed with exit code 1

with this recipe:

  - versionName: 5.0.127
    versionCode: 127
    commit: 6388977ce7b00bdfac9b1e2ca56151bf2dd4d9e2
    output: build/app/outputs/flutter-apk/app-release.apk
    srclibs:
      - flutter@stable
    rm:
      - ios
      - linux
      - macos
      - samples
      - snap
      - test_driver
      - web
      - windows
    prebuild:
      - export version=$(grep "flutter\:\ " codemagic.yaml | tr -d ' ' | cut -d ":"
        -f2)
      - pushd $$flutter$$
      - git checkout -f $version
      - popd
      - cp lib/.env.dart.example lib/.env.dart
      - cp android/app/build.gradle.dev android/app/build.gradle
      - cp android/build.gradle.foss android/build.gradle
      - cp lib/utils/app_review.dart.foss lib/utils/app_review.dart
      - cp lib/utils/oauth.dart.foss lib/utils/oauth.dart
      - cp lib/ui/app/pinput.dart.foss lib/ui/app/pinput.dart
      - cp lib/ui/app/upgrade_dialog.dart.foss lib/ui/app/upgrade_dialog.dart
      - cp android/app/src/main/AndroidManifest.foss.xml android/app/src/main/AndroidManifest.xml
      - cp pubspec.foss.yaml pubspec.yaml
      - sed -i -e '/google_sign_in/d' -e '/in_app_review/d' -e '/in_app_purchase/d'
        pubspec.yaml
      - sed -i -e '/^  google_sign_in/,/version:/d' -e '/^  in_app_review/,/version:/d'
        -e '/^  in_app_purchase/,/version:/d' pubspec.lock
      - export PUB_CACHE=$(pwd)/.pub-cache
      - $$flutter$$/bin/flutter config --no-analytics
      - $$flutter$$/bin/flutter pub get
    scandelete:
      - .pub-cache
    build:
      - export PUB_CACHE=$(pwd)/.pub-cache
      - $$flutter$$/bin/flutter build apk
    ndk: r20

@hillelcoren what am I missing?

hillelcoren commented 11 months ago

I've checked in a change to update the Kotlin version which I believe should help.

licaon-kter commented 11 months ago

tried: https://github.com/invoiceninja/admin-portal/commit/b3e120d9793d77af0492685817c2054389d1447d

...
Downloading android-x64-release/linux-x64 tools...                 934ms

Upgrading build.gradle
Running Gradle task 'assembleRelease'...                        
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
lib/ui/app/pinput.dart:6:24: Error: The parameter 'key' can't have a value of 'null' because of its type 'Key', but the implicit default value is 'null'.
 - 'Key' is from 'package:flutter/src/foundation/key.dart' ('../srclib/flutter/packages/flutter/lib/src/foundation/key.dart').
Try adding either an explicit non-'null' default value or the 'required' modifier.
  const AppPinput({Key key, this.onCompleted}) : super(key: key);
                       ^^^
lib/ui/app/pinput.dart:6:34: Error: The parameter 'onCompleted' can't have a value of 'null' because of its type 'void Function(String)', but the implicit default value is 'null'.
Try adding either an explicit non-'null' default value or the 'required' modifier.
  const AppPinput({Key key, this.onCompleted}) : super(key: key);
                                 ^^^^^^^^^^^
lib/ui/auth/login_vm.dart:170:29: Error: This expression has type 'void' and can't be used.
          await GoogleOAuth.signOut();
                            ^
lib/ui/auth/login_vm.dart:204:29: Error: This expression has type 'void' and can't be used.
          await GoogleOAuth.signOut();
                            ^
lib/utils/oauth.dart:5:23: Error: A non-null value must be returned since the return type 'bool' doesn't allow null.
  static Future<bool> signIn(Function(String, String) callback, {bool isSilent = false}) async {
                      ^
lib/utils/oauth.dart:9:23: Error: A non-null value must be returned since the return type 'bool' doesn't allow null.
  static Future<bool> signUp(Function(String, String) callback) async {
                      ^
lib/utils/oauth.dart:13:23: Error: A non-null value must be returned since the return type 'bool' doesn't allow null.
  static Future<bool> requestGmailScope() async {
                      ^
lib/utils/app_review.dart:11:41: Error: The argument type 'BuildContext?' can't be assigned to the parameter type 'BuildContext' because 'BuildContext?' is nullable and 'BuildContext' isn't.
 - 'BuildContext' is from 'package:flutter/src/widgets/framework.dart' ('../srclib/flutter/packages/flutter/lib/src/widgets/framework.dart').
      launch(getRateAppURL(navigatorKey.currentContext));
                                        ^
lib/ui/app/pinput.dart:15:27: Error: Property 'code' cannot be accessed on 'AppLocalization?' because it is potentially null.
 - 'AppLocalization' is from 'package:invoiceninja_flutter/utils/localization.dart' ('lib/utils/localization.dart').
Try accessing using ?. instead.
      label: localization.code,
                          ^^^^
lib/ui/app/pinput.dart:20:40: Error: Property 'pleaseEnterACode' cannot be accessed on 'AppLocalization?' because it is potentially null.
 - 'AppLocalization' is from 'package:invoiceninja_flutter/utils/localization.dart' ('lib/utils/localization.dart').
Try accessing using ?. instead.
          value.isEmpty ? localization.pleaseEnterACode : null,
                                       ^^^^^^^^^^^^^^^^
Target kernel_snapshot failed: Exception

FAILURE: Build failed with an exception.

* Where:
Script '/home/vagrant/build/srclib/flutter/packages/flutter_tools/gradle/src/main/groovy/flutter.groovy' line: 1297

* What went wrong:
Execution failed for task ':app:compileFlutterBuildRelease'.
> Process 'command '/home/vagrant/build/srclib/flutter/bin/flutter'' finished with non-zero exit value 1
hillelcoren commented 11 months ago

I've checked in fixes for these issues and confirmed the FOSS version now builds correctly.

licaon-kter commented 11 months ago

Builds fine now, thanks: https://gitlab.com/fdroid/fdroiddata/-/commit/5e4320a190455320355116f362455d19d4273374

licaon-kter commented 1 month ago

I'll just reopen this one, ref: https://gitlab.com/fdroid/fdroiddata/-/jobs/7717792311#L2027

/LE: fyi https://gitlab.com/fdroid/fdroiddata/-/commit/6d58b153ab12dabcad785a0fb9b2d9405e70df8c

hillelcoren commented 1 month ago

Thanks, I'll look into it

hillelcoren commented 3 weeks ago

We've tagged a new release with a fix

licaon-kter commented 3 weeks ago

@hillelcoren builds fine thanks https://gitlab.com/fdroid/fdroiddata/-/commit/086b9d739356c9a1f5e37f19ce2f2825f59b3171