fix android

This commit is contained in:
John Smith 2022-03-12 15:27:15 -05:00
parent aae616a1ff
commit cd09203737
12 changed files with 60 additions and 62 deletions

@ -1 +1 @@
Subproject commit 935ca957d7e223ef560a0b20b656730a325e0ba7 Subproject commit 085982c42704f9097c78e5f9848f345fbf888485

View File

@ -49,9 +49,9 @@ android {
} }
dependencies { dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0' implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.3.0' implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4' implementation 'androidx.constraintlayout:constraintlayout:2.1.2'
implementation 'androidx.security:security-crypto:1.1.0-alpha03' implementation 'androidx.security:security-crypto:1.1.0-alpha03'
testImplementation 'junit:junit:4.13.2' testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'

View File

@ -28,3 +28,5 @@
.packages .packages
build/ build/
.flutter .flutter
.gradle
local.properties

View File

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.4.32' ext.kotlin_version = '1.6.10'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()
@ -29,7 +29,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android' apply plugin: 'kotlin-android'
android { android {
compileSdkVersion 30 compileSdkVersion 31
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@ -46,7 +46,7 @@ android {
defaultConfig { defaultConfig {
minSdkVersion 24 minSdkVersion 24
targetSdkVersion 30 targetSdkVersion 31
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
@ -74,7 +74,7 @@ android {
} }
dependencies { 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" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
} }

View File

@ -1,5 +1,6 @@
package com.veilid.veilid package com.veilid.veilid
import android.util.Log;
import androidx.annotation.NonNull import androidx.annotation.NonNull
import android.content.Context import android.content.Context
import io.flutter.embedding.engine.plugins.FlutterPlugin import io.flutter.embedding.engine.plugins.FlutterPlugin
@ -20,7 +21,7 @@ class VeilidPlugin: FlutterPlugin, MethodCallHandler {
external fun init_android(ctx: Context) external fun init_android(ctx: Context)
override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) { override fun onAttachedToEngine(@NonNull flutterPluginBinding: FlutterPlugin.FlutterPluginBinding) {
init_android(flutterPluginBinding.getApplicationContext()) init_android(flutterPluginBinding.applicationContext)
} }
override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) { override fun onMethodCall(@NonNull call: MethodCall, @NonNull result: Result) {

View File

@ -45,7 +45,7 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.veilid.veilid_example" applicationId "com.veilid.veilid_example"
minSdkVersion Math.max(flutter.minSdkVersion, 24) minSdkVersion Math.max(flutter.minSdkVersion, 24)
targetSdkVersion Math.max(flutter.targetSdkVersion, 30) targetSdkVersion Math.max(flutter.targetSdkVersion, 31)
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()
versionName flutterVersionName versionName flutterVersionName
} }
@ -64,6 +64,5 @@ flutter {
} }
dependencies { dependencies {
implementation 'androidx.security:security-crypto:1.1.0-alpha03'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
} }

View File

@ -1,5 +1,5 @@
buildscript { buildscript {
ext.kotlin_version = '1.4.32' ext.kotlin_version = '1.6.10'
repositories { repositories {
google() google()
mavenCentral() mavenCentral()

View File

@ -21,7 +21,7 @@ packages:
name: change_case name: change_case
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.2"
characters: characters:
dependency: transitive dependency: transitive
description: description:
@ -316,5 +316,5 @@ packages:
source: hosted source: hosted
version: "0.2.0+1" version: "0.2.0+1"
sdks: sdks:
dart: ">=2.15.1 <3.0.0" dart: ">=2.16.1 <3.0.0"
flutter: ">=2.8.0" flutter: ">=2.8.0"

View File

@ -7,8 +7,7 @@ version: 1.0.0+1
publish_to: "none" # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment: environment:
sdk: ">=2.15.1 <3.0.0" sdk: ">=2.16.1 <3.0.0"
flutter: ">=2.5.0"
# Dependencies specify other packages that your package needs in order to work. # Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions # To automatically upgrade your package dependencies to the latest versions

View File

@ -5,7 +5,7 @@ homepage: https://veilid.com
publish_to: "none" # Remove this line if you wish to publish to pub.dev publish_to: "none" # Remove this line if you wish to publish to pub.dev
environment: environment:
sdk: ">=2.15.1 <3.0.0" sdk: ">=2.16.1 <3.0.0"
flutter: ">=2.5.0" flutter: ">=2.5.0"
dependencies: dependencies:

View File

@ -29,29 +29,29 @@ IF NOT DEFINED CARGO_FOUND (
) )
echo [X] Cargo is available in the path echo [X] Cargo is available in the path
REM ensure winget is installed @REM REM ensure winget is installed
FOR %%X IN (winget.exe) DO (SET WINGET_FOUND=%%~$PATH:X) @REM FOR %%X IN (winget.exe) DO (SET WINGET_FOUND=%%~$PATH:X)
IF NOT DEFINED WINGET_FOUND ( @REM 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 @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
echo https://docs.microsoft.com/en-us/windows/package-manager/winget/ @REM echo https://docs.microsoft.com/en-us/windows/package-manager/winget/
goto end @REM goto end
) @REM )
echo [X] Winget is available in the path @REM echo [X] Winget is available in the path
rem install cargo cbindgen @REM rem install cargo cbindgen
cargo install cbindgen @REM cargo install cbindgen
rem install dart ffigen @REM rem install dart ffigen
call dart pub global activate ffigen @REM call dart pub global activate ffigen
rem install flutter_rust_bridge_codegen @REM rem install flutter_rust_bridge_codegen
cargo install flutter_rust_bridge_codegen @REM cargo install flutter_rust_bridge_codegen
rem install just @REM rem install just
cargo install just @REM cargo install just
rem ensure packages are installed @REM rem ensure packages are installed
winget install -e --id LLVM.LLVM --accept-package-agreements --accept-source-agreements @REM winget install -e --id LLVM.LLVM --accept-package-agreements --accept-source-agreements
rem ensure windows is enabled in flutter rem ensure windows is enabled in flutter
call flutter config --enable-windows-desktop --no-enable-android call flutter config --enable-windows-desktop --no-enable-android

View File

@ -40,47 +40,44 @@ else
exit 1 exit 1
fi fi
# install cargo cbindgen # # install cargo cbindgen
cargo install cbindgen # cargo install cbindgen
# install dart ffigen # # install dart ffigen
dart pub global activate ffigen # dart pub global activate ffigen
# install flutter_rust_bridge_codegen # # install flutter_rust_bridge_codegen
cargo install flutter_rust_bridge_codegen # cargo install flutter_rust_bridge_codegen
# install just
cargo install just
# platform specific stuff # platform specific stuff
if [ "$OS" == "linux" ]; then if [ "$OS" == "linux" ]; then
# ensure packages are installed # # ensure packages are installed
echo "Must sudo to root to install LLVM package:" # echo "Must sudo to root to install LLVM package:"
sudo apt-get install libclang-dev # sudo apt-get install libclang-dev
# ensure platforms are enabled in flutter # ensure platforms are enabled in flutter
flutter config --enable-linux-desktop --enable-android flutter config --enable-linux-desktop --enable-android
elif [ "$OS" == "macos" ]; then elif [ "$OS" == "macos" ]; then
# ensure x86_64 homebrew is installed # # ensure x86_64 homebrew is installed
if [ -f /usr/local/bin/brew ] &> /dev/null; then # if [ -f /usr/local/bin/brew ] &> /dev/null; then
echo '[X] x86_64 homebrew is available' # echo '[X] x86_64 homebrew is available'
else # else
echo 'x86_64 homebrew is not available, run this:' # echo 'x86_64 homebrew is not available, run this:'
echo 'arch -x86_64 zsh' # echo 'arch -x86_64 zsh'
echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"' # echo '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"'
exit 1 # exit 1
fi # fi
# ensure packages are installed # ensure packages are installed
if [ "$BREW_USER" == "" ]; then # if [ "$BREW_USER" == "" ]; then
BREW_USER=`ls -lad /usr/local/bin/. | cut -d\ -f4` # BREW_USER=`ls -lad /usr/local/bin/. | cut -d\ -f4`
echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:" # echo "Must sudo to homebrew user \"$BREW_USER\" to install LLVM package:"
fi # fi
sudo -H -u $BREW_USER arch -x86_64 /usr/local/bin/brew install llvm # sudo -H -u $BREW_USER arch -x86_64 /usr/local/bin/brew install llvm
echo "Must sudo to root to install CocoaPods gem:" 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 sudo arch -x86_64 gem install cocoapods
# ensure platforms are enabled in flutter # ensure platforms are enabled in flutter