From cd09203737c24c5c2873a41590a5d4834919761b Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 12 Mar 2022 15:27:15 -0500 Subject: [PATCH] fix android --- external/keyring-manager | 2 +- .../src/tests/android/app/build.gradle | 6 +-- veilid-flutter/.gitignore | 2 + veilid-flutter/android/build.gradle | 8 +-- .../kotlin/com/veilid/veilid/VeilidPlugin.kt | 3 +- .../example/android/app/build.gradle | 3 +- veilid-flutter/example/android/build.gradle | 2 +- veilid-flutter/example/pubspec.lock | 4 +- veilid-flutter/example/pubspec.yaml | 3 +- veilid-flutter/pubspec.yaml | 2 +- veilid-flutter/setup_flutter.bat | 36 ++++++------- veilid-flutter/setup_flutter.sh | 51 +++++++++---------- 12 files changed, 60 insertions(+), 62 deletions(-) diff --git a/external/keyring-manager b/external/keyring-manager index 935ca957..085982c4 160000 --- a/external/keyring-manager +++ b/external/keyring-manager @@ -1 +1 @@ -Subproject commit 935ca957d7e223ef560a0b20b656730a325e0ba7 +Subproject commit 085982c42704f9097c78e5f9848f345fbf888485 diff --git a/veilid-core/src/tests/android/app/build.gradle b/veilid-core/src/tests/android/app/build.gradle index 28db6718..f12a7cda 100644 --- a/veilid-core/src/tests/android/app/build.gradle +++ b/veilid-core/src/tests/android/app/build.gradle @@ -49,9 +49,9 @@ android { } dependencies { - implementation 'androidx.appcompat:appcompat:1.3.0' - implementation 'com.google.android.material:material:1.3.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'com.google.android.material:material:1.4.0' + implementation 'androidx.constraintlayout:constraintlayout:2.1.2' implementation 'androidx.security:security-crypto:1.1.0-alpha03' testImplementation 'junit:junit:4.13.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2' diff --git a/veilid-flutter/.gitignore b/veilid-flutter/.gitignore index d3e1dce8..bf356e54 100644 --- a/veilid-flutter/.gitignore +++ b/veilid-flutter/.gitignore @@ -28,3 +28,5 @@ .packages build/ .flutter +.gradle +local.properties diff --git a/veilid-flutter/android/build.gradle b/veilid-flutter/android/build.gradle index 7950329a..8dff52d5 100644 --- a/veilid-flutter/android/build.gradle +++ b/veilid-flutter/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.4.32' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() @@ -29,7 +29,7 @@ apply plugin: 'com.android.library' apply plugin: 'kotlin-android' android { - compileSdkVersion 30 + compileSdkVersion 31 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -46,7 +46,7 @@ android { defaultConfig { minSdkVersion 24 - targetSdkVersion 30 + targetSdkVersion 31 versionCode 1 versionName "1.0" @@ -74,7 +74,7 @@ android { } dependencies { - implementation 'androidx.security:security-crypto:1.1.0-alpha03' + implementation "androidx.security:security-crypto:1.1.0-alpha03" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/veilid-flutter/android/src/main/kotlin/com/veilid/veilid/VeilidPlugin.kt b/veilid-flutter/android/src/main/kotlin/com/veilid/veilid/VeilidPlugin.kt index 1d5995da..43a55789 100644 --- a/veilid-flutter/android/src/main/kotlin/com/veilid/veilid/VeilidPlugin.kt +++ b/veilid-flutter/android/src/main/kotlin/com/veilid/veilid/VeilidPlugin.kt @@ -1,5 +1,6 @@ package com.veilid.veilid +import android.util.Log; import androidx.annotation.NonNull import android.content.Context import io.flutter.embedding.engine.plugins.FlutterPlugin @@ -20,7 +21,7 @@ class VeilidPlugin: FlutterPlugin, MethodCallHandler { external fun init_android(ctx: Context) override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { - init_android(flutterPluginBinding.getApplicationContext()) + init_android(flutterPluginBinding.applicationContext) } override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { diff --git a/veilid-flutter/example/android/app/build.gradle b/veilid-flutter/example/android/app/build.gradle index 16b5d357..a60d89ba 100644 --- a/veilid-flutter/example/android/app/build.gradle +++ b/veilid-flutter/example/android/app/build.gradle @@ -45,7 +45,7 @@ android { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId "com.veilid.veilid_example" minSdkVersion Math.max(flutter.minSdkVersion, 24) - targetSdkVersion Math.max(flutter.targetSdkVersion, 30) + targetSdkVersion Math.max(flutter.targetSdkVersion, 31) versionCode flutterVersionCode.toInteger() versionName flutterVersionName } @@ -64,6 +64,5 @@ flutter { } dependencies { - implementation 'androidx.security:security-crypto:1.1.0-alpha03' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" } diff --git a/veilid-flutter/example/android/build.gradle b/veilid-flutter/example/android/build.gradle index 10ab8e50..4256f917 100644 --- a/veilid-flutter/example/android/build.gradle +++ b/veilid-flutter/example/android/build.gradle @@ -1,5 +1,5 @@ buildscript { - ext.kotlin_version = '1.4.32' + ext.kotlin_version = '1.6.10' repositories { google() mavenCentral() diff --git a/veilid-flutter/example/pubspec.lock b/veilid-flutter/example/pubspec.lock index e36702f1..7a9996d9 100644 --- a/veilid-flutter/example/pubspec.lock +++ b/veilid-flutter/example/pubspec.lock @@ -21,7 +21,7 @@ packages: name: change_case url: "https://pub.dartlang.org" source: hosted - version: "1.0.1" + version: "1.0.2" characters: dependency: transitive description: @@ -316,5 +316,5 @@ packages: source: hosted version: "0.2.0+1" sdks: - dart: ">=2.15.1 <3.0.0" + dart: ">=2.16.1 <3.0.0" flutter: ">=2.8.0" diff --git a/veilid-flutter/example/pubspec.yaml b/veilid-flutter/example/pubspec.yaml index 62dfa08d..e4038ee1 100644 --- a/veilid-flutter/example/pubspec.yaml +++ b/veilid-flutter/example/pubspec.yaml @@ -7,8 +7,7 @@ version: 1.0.0+1 publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.15.1 <3.0.0" - flutter: ">=2.5.0" + sdk: ">=2.16.1 <3.0.0" # Dependencies specify other packages that your package needs in order to work. # To automatically upgrade your package dependencies to the latest versions diff --git a/veilid-flutter/pubspec.yaml b/veilid-flutter/pubspec.yaml index c4b48d84..377c29b1 100644 --- a/veilid-flutter/pubspec.yaml +++ b/veilid-flutter/pubspec.yaml @@ -5,7 +5,7 @@ homepage: https://veilid.com publish_to: "none" # Remove this line if you wish to publish to pub.dev environment: - sdk: ">=2.15.1 <3.0.0" + sdk: ">=2.16.1 <3.0.0" flutter: ">=2.5.0" dependencies: diff --git a/veilid-flutter/setup_flutter.bat b/veilid-flutter/setup_flutter.bat index e5748fa0..6a5b4a5b 100644 --- a/veilid-flutter/setup_flutter.bat +++ b/veilid-flutter/setup_flutter.bat @@ -29,29 +29,29 @@ IF NOT DEFINED CARGO_FOUND ( ) echo [X] Cargo is available in the path -REM ensure winget is installed -FOR %%X IN (winget.exe) DO (SET WINGET_FOUND=%%~$PATH:X) -IF NOT DEFINED WINGET_FOUND ( - echo Winget is not available in the path, ensure your version of Windows is new enough and has Winget installed from the Microsoft Store - echo https://docs.microsoft.com/en-us/windows/package-manager/winget/ - goto end -) -echo [X] Winget is available in the path +@REM REM ensure winget is installed +@REM FOR %%X IN (winget.exe) DO (SET WINGET_FOUND=%%~$PATH:X) +@REM IF NOT DEFINED WINGET_FOUND ( +@REM echo Winget is not available in the path, ensure your version of Windows is new enough and has Winget installed from the Microsoft Store +@REM echo https://docs.microsoft.com/en-us/windows/package-manager/winget/ +@REM goto end +@REM ) +@REM echo [X] Winget is available in the path -rem install cargo cbindgen -cargo install cbindgen +@REM rem install cargo cbindgen +@REM cargo install cbindgen -rem install dart ffigen -call dart pub global activate ffigen +@REM rem install dart ffigen +@REM call dart pub global activate ffigen -rem install flutter_rust_bridge_codegen -cargo install flutter_rust_bridge_codegen +@REM rem install flutter_rust_bridge_codegen +@REM cargo install flutter_rust_bridge_codegen -rem install just -cargo install just +@REM rem install just +@REM cargo install just -rem ensure packages are installed -winget install -e --id LLVM.LLVM --accept-package-agreements --accept-source-agreements +@REM rem ensure packages are installed +@REM winget install -e --id LLVM.LLVM --accept-package-agreements --accept-source-agreements rem ensure windows is enabled in flutter call flutter config --enable-windows-desktop --no-enable-android diff --git a/veilid-flutter/setup_flutter.sh b/veilid-flutter/setup_flutter.sh index ae41edc2..b57f37d0 100755 --- a/veilid-flutter/setup_flutter.sh +++ b/veilid-flutter/setup_flutter.sh @@ -40,47 +40,44 @@ else exit 1 fi -# install cargo cbindgen -cargo install cbindgen +# # install cargo cbindgen +# cargo install cbindgen -# install dart ffigen -dart pub global activate ffigen +# # install dart ffigen +# dart pub global activate ffigen -# install flutter_rust_bridge_codegen -cargo install flutter_rust_bridge_codegen - -# install just -cargo install just +# # install flutter_rust_bridge_codegen +# cargo install flutter_rust_bridge_codegen # platform specific stuff if [ "$OS" == "linux" ]; then - # ensure packages are installed - echo "Must sudo to root to install LLVM package:" - sudo apt-get install libclang-dev + # # ensure packages are installed + # echo "Must sudo to root to install LLVM package:" + # sudo apt-get install libclang-dev # ensure platforms are enabled in flutter flutter config --enable-linux-desktop --enable-android elif [ "$OS" == "macos" ]; then - # ensure x86_64 homebrew is installed - if [ -f /usr/local/bin/brew ] &> /dev/null; then - echo '[X] x86_64 homebrew is available' - else - echo 'x86_64 homebrew is not available, run this:' - echo 'arch -x86_64 zsh' - echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' - exit 1 - fi + # # ensure x86_64 homebrew is installed + # if [ -f /usr/local/bin/brew ] &> /dev/null; then + # echo '[X] x86_64 homebrew is available' + # else + # echo 'x86_64 homebrew is not available, run this:' + # echo 'arch -x86_64 zsh' + # echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' + # exit 1 + # fi # ensure packages are installed - if [ "$BREW_USER" == "" ]; then - BREW_USER=`ls -lad /usr/local/bin/. | cut -d\ -f4` - echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:" - fi - sudo -H -u $BREW_USER arch -x86_64 /usr/local/bin/brew install llvm + # if [ "$BREW_USER" == "" ]; then + # BREW_USER=`ls -lad /usr/local/bin/. | cut -d\ -f4` + # echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:" + # fi + # sudo -H -u $BREW_USER arch -x86_64 /usr/local/bin/brew install llvm echo "Must sudo to root to install CocoaPods gem:" - sudo arch -x86_64 gem install ffi + # sudo arch -x86_64 gem install ffi sudo arch -x86_64 gem install cocoapods # ensure platforms are enabled in flutter