Skip to content

Commit 136c365

Browse files
buenaflordenrase
andauthored
fix: sample app (#2358)
* make spotlight work on android with network security config * fix isar example error in prod build * add reporting of TTFD * update * Update isar user * fix isar user scheme * update versions to work on android studio 2024.2.1 * update versions * update java version in ci * update --------- Co-authored-by: Denis Andrasec <[email protected]>
1 parent 94757e3 commit 136c365

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
lines changed

.github/workflows/flutter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
- uses: actions/setup-java@v4
6161
if: ${{ matrix.target == 'android' }}
6262
with:
63-
java-version: '11'
63+
java-version: '17'
6464
distribution: 'adopt'
6565

6666
# Install required dependencies for Flutter on Linux on Ubuntu

flutter/example/android/app/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ apply plugin: 'com.ydq.android.gradle.native-aar.import'
3131
// apply plugin: 'io.sentry.android.gradle'
3232

3333
android {
34+
namespace = "io.sentry.samples.flutter"
3435
compileOptions {
3536
sourceCompatibility = JavaVersion.VERSION_1_8
3637
targetCompatibility = JavaVersion.VERSION_1_8

flutter/example/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1717
android:hardwareAccelerated="true"
1818
android:windowSoftInputMode="adjustResize"
19-
android:exported="true">
19+
android:exported="true"
20+
android:networkSecurityConfig="@xml/network">
2021
<!-- Specifies an Android theme to apply to this Activity as soon as
2122
the Android process has started. This theme is visible to the user
2223
while the Flutter UI initializes. After that, this theme continues

flutter/example/android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ buildscript {
77
}
88

99
dependencies {
10-
classpath 'io.sentry:sentry-android-gradle-plugin:4.5.0'
11-
classpath 'com.android.tools.build:gradle:7.4.2'
10+
classpath 'io.sentry:sentry-android-gradle-plugin:4.12.0'
11+
classpath 'com.android.tools.build:gradle:8.3.2'
1212
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1313
classpath 'io.github.howardpang:androidNativeBundle:1.1.3'
1414
}
@@ -26,7 +26,7 @@ subprojects {
2626
project.buildDir = "${rootProject.buildDir}/${project.name}"
2727
}
2828
subprojects {
29-
project.evaluationDependsOn(':app')
29+
project.evaluationDependsOn(":app")
3030
}
3131

3232
tasks.register("clean", Delete) {
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
#Wed Oct 16 15:46:36 CEST 2024
12
distributionBase=GRADLE_USER_HOME
23
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

flutter/example/lib/isar/user.g.dart

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flutter/example/lib/main.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ class MyApp extends StatefulWidget {
114114
class _MyAppState extends State<MyApp> {
115115
@override
116116
Widget build(BuildContext context) {
117+
Future.delayed(const Duration(seconds: 3), () {
118+
SentryFlutter.reportFullyDisplayed();
119+
});
117120
return feedback.BetterFeedback(
118121
child: ChangeNotifierProvider<ThemeProvider>(
119122
create: (_) => ThemeProvider(),
@@ -231,7 +234,7 @@ class MainScaffold extends StatelessWidget {
231234
TooltipButton(
232235
onPressed: isarTest,
233236
text:
234-
'Executes CRUD operations on an in-memory with Isart and sends the created transaction to Sentry.',
237+
'Executes CRUD operations on an in-memory with Isar and sends the created transaction to Sentry.',
235238
buttonTitle: 'isar',
236239
),
237240
TooltipButton(

flutter/example/pubspec_overrides.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,13 @@ dependency_overrides:
1717
path: ../../drift
1818
sentry_isar:
1919
path: ../../isar
20+
# isar community fork is more stable
21+
isar:
22+
version: ^3.1.0
23+
hosted: https://pub.isar-community.dev/
24+
isar_flutter_libs:
25+
version: ^3.1.0
26+
hosted: https://pub.isar-community.dev/
27+
isar_generator:
28+
version: ^3.1.0
29+
hosted: https://pub.isar-community.dev/

0 commit comments

Comments
 (0)