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 {
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'

View File

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

View File

@ -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"
}

View File

@ -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) {

View File

@ -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"
}

View File

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

View File

@ -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"

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
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

View File

@ -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:

View File

@ -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

View File

@ -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