android fixes

This commit is contained in:
John Smith
2022-09-07 10:33:14 -04:00
parent a12d8da6d1
commit c36db533f2
12 changed files with 59 additions and 30 deletions

View File

@@ -41,6 +41,13 @@ android {
main.java.srcDirs += 'src/main/kotlin'
}
// xxx why does backtrace not work in android?
// tried this but it doesn't help
// packagingOptions {
// jniLibs.useLegacyPackaging = true
// }
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.veilid.veilid_example"

View File

@@ -1,5 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.veilid.veilid_example">
package="com.veilid.veilid_example">
<application
android:label="veilid_example"
android:name="${applicationName}"

View File

@@ -6,7 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

View File

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip

View File

@@ -161,21 +161,30 @@ class _MyAppState extends State<MyApp> with UiLoggy {
}
Future<void> processUpdateLog(VeilidUpdateLog update) async {
StackTrace? stackTrace;
Object? error;
final backtrace = update.backtrace;
if (backtrace != null) {
stackTrace =
StackTrace.fromString("$backtrace\n${StackTrace.current.toString()}");
error = 'embedded stack trace for ${update.logLevel} ${update.message}';
}
switch (update.logLevel) {
case VeilidLogLevel.error:
loggy.error(update.message);
loggy.error(update.message, error, stackTrace);
break;
case VeilidLogLevel.warn:
loggy.warning(update.message);
loggy.warning(update.message, error, stackTrace);
break;
case VeilidLogLevel.info:
loggy.info(update.message);
loggy.info(update.message, error, stackTrace);
break;
case VeilidLogLevel.debug:
loggy.debug(update.message);
loggy.debug(update.message, error, stackTrace);
break;
case VeilidLogLevel.trace:
loggy.trace(update.message);
loggy.trace(update.message, error, stackTrace);
break;
}
}