Skip to content

Commit 27c0cfa

Browse files
Merge pull request #179 from backtrace-labs/android-sdk-36
Upgrade to Android SDK 36 and Gradle 8.14
2 parents 19ef834 + 0377711 commit 27c0cfa

File tree

10 files changed

+122
-149
lines changed

10 files changed

+122
-149
lines changed

backtrace-library/build.gradle

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
plugins {
22
id 'com.android.library'
33
id 'com.gladed.androidgitversion' version '0.4.14'
4-
id "com.vanniktech.maven.publish" version "0.29.0" apply true
4+
id "com.vanniktech.maven.publish" version "0.34.0" apply true
55
}
66

7-
import com.vanniktech.maven.publish.SonatypeHost
8-
97
androidGitVersion {
108
// this is the format for generating the versionName
119
// default is %tag%%-count%%-commit%%-branch%%-dirty% - removed %-dirty% because submodules tend to get dirty
@@ -16,10 +14,10 @@ android {
1614
namespace "backtraceio.library"
1715
defaultConfig {
1816
minSdkVersion 21
19-
compileSdk 35
20-
// TODO: BT-5924 Android 35+ update -> noinspection OldTargetApi,EditedTargetSdkVersion
21-
targetSdkVersion 35
17+
compileSdk 36
18+
targetSdkVersion 36
2219
ndkVersion "27.0.11718014-beta1"
20+
versionName androidGitVersion.name()
2321
buildConfigField("String", "VERSION_NAME", "\"${versionName}\"")
2422

2523
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -43,7 +41,7 @@ android {
4341
buildTypes {
4442
buildTypes {
4543
debug {
46-
testCoverageEnabled true
44+
testCoverageEnabled false
4745
}
4846
}
4947
release {
@@ -73,7 +71,7 @@ android {
7371
}
7472

7573
mavenPublishing {
76-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
74+
publishToMavenCentral()
7775
signAllPublications()
7876
coordinates(GROUP, POM_NAME, android.defaultConfig.versionName)
7977

@@ -114,18 +112,18 @@ mavenPublishing {
114112
}
115113

116114
dependencies {
117-
implementation 'com.google.code.gson:gson:2.12.1'
115+
implementation 'com.google.code.gson:gson:2.13.1'
118116
implementation 'androidx.appcompat:appcompat:1.6.1'
119117
implementation 'com.squareup:tape:1.2.3'
120118
testImplementation 'junit:junit:4.13.2'
121-
testImplementation "org.mockito:mockito-core:5.16.0"
122-
testImplementation 'org.json:json:20240303'
123-
testImplementation "com.google.guava:guava:33.3.1-jre"
119+
testImplementation "org.mockito:mockito-core:5.18.0"
120+
testImplementation 'org.json:json:20250517'
121+
testImplementation "com.google.guava:guava:33.4.8-jre"
124122
androidTestImplementation 'net.jodah:concurrentunit:0.4.6'
125-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
126-
androidTestImplementation 'androidx.test:rules:1.6.1'
127-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
123+
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
124+
androidTestImplementation 'androidx.test:rules:1.7.0'
125+
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
128126
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
129-
androidTestImplementation 'org.mockito:mockito-core:5.16.0'
130-
androidTestImplementation "org.mockito:mockito-android:5.16.0"
127+
androidTestImplementation 'org.mockito:mockito-core:5.18.0'
128+
androidTestImplementation "org.mockito:mockito-android:5.18.0"
131129
}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
mavenCentral()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:8.5.2'
10+
classpath 'com.android.tools.build:gradle:8.11.1'
1111
// NOTE: Do not place your application dependencies here; they belong
1212
// in the individual module build.gradle files
1313
}

coroner-client/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ java {
99

1010
dependencies {
1111
implementation fileTree(dir: 'libs', include: ['*.jar'])
12-
implementation 'com.google.code.gson:gson:2.12.1'
12+
implementation 'com.google.code.gson:gson:2.13.1'
1313
testImplementation 'junit:junit:4.13.2'
14-
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.16.0'
14+
testImplementation group: 'org.mockito', name: 'mockito-core', version: '5.18.0'
1515
}

example-app/build.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ apply plugin: 'com.android.application'
33
android {
44
namespace "backtraceio.backtraceio"
55
defaultConfig {
6-
compileSdk 35
6+
compileSdk 36
77
applicationId "backtraceio.backtraceio"
88
minSdkVersion 21
9-
// TODO: BT-5924 Android 35+ update -> noinspection OldTargetApi,EditedTargetSdkVersion
10-
targetSdkVersion 35
9+
targetSdkVersion 36
1110
versionCode 1
1211
versionName "1.0"
1312
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
@@ -64,10 +63,10 @@ String getProperty(String name, String defaultValue) {
6463
dependencies {
6564
implementation fileTree(include: ['*.jar'], dir: 'libs')
6665
implementation 'androidx.appcompat:appcompat:1.6.1'
67-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
66+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
6867
testImplementation 'junit:junit:4.13.2'
69-
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
70-
androidTestImplementation 'androidx.test:rules:1.6.1'
68+
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
69+
androidTestImplementation 'androidx.test:rules:1.7.0'
7170
androidTestImplementation 'net.jodah:concurrentunit:0.4.6'
7271
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
7372
implementation project(':backtrace-library')

example-app/src/androidTest/java/backtraceio/backtraceio/ExampleInstrumentedTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515

1616
import org.junit.Assert;
1717
import org.junit.Before;
18-
import org.junit.Ignore;
1918
import org.junit.Rule;
2019
import org.junit.Test;
2120
import org.junit.runner.RunWith;
@@ -26,6 +25,8 @@
2625

2726
import backtraceio.coroner.response.CoronerResponse;
2827
import backtraceio.coroner.response.CoronerResponseProcessingException;
28+
import backtraceio.library.logger.BacktraceLogger;
29+
import backtraceio.library.logger.LogLevel;
2930

3031
/**
3132
* Instrumented test, which will execute on an Android device.
@@ -42,6 +43,7 @@ public class ExampleInstrumentedTest extends InstrumentedTest {
4243

4344
@Before
4445
public void enableMetricsAndBreadcrumbs() {
46+
BacktraceLogger.setLevel(LogLevel.DEBUG);
4547
onView(withId(R.id.enableBreadcrumbs)).perform(click());
4648
}
4749

@@ -52,7 +54,6 @@ public void useAppContext() {
5254
assertEquals("backtraceio.backtraceio", appContext.getPackageName());
5355
}
5456

55-
@Ignore("// TODO: BT-5924 Android 35+ update")
5657
@Test
5758
public void handledException() throws TimeoutException, CoronerResponseProcessingException, InterruptedException {
5859
// GIVEN
@@ -88,7 +89,6 @@ public void handledException() throws TimeoutException, CoronerResponseProcessin
8889
Assert.assertEquals("java.lang.IndexOutOfBoundsException", resultClassifier);
8990
}
9091

91-
@Ignore("// TODO: BT-5924 Android 35+ update")
9292
@Test
9393
public void dumpWithoutCrash() throws CoronerResponseProcessingException, InterruptedException {
9494
// GIVEN

example-app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
android:label="@string/app_name"
1111
android:roundIcon="@mipmap/ic_launcher_round"
1212
android:supportsRtl="true"
13-
android:theme="@style/AppTheme"
14-
android:extractNativeLibs="false">
13+
android:theme="@style/AppTheme">
1514
<activity android:name=".MainActivity"
1615
android:exported="true">
1716
<intent-filter>
@@ -21,4 +20,4 @@
2120
</intent-filter>
2221
</activity>
2322
</application>
24-
</manifest>
23+
</manifest>

example-app/src/main/res/layout/activity_main.xml

Lines changed: 86 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -6,129 +6,103 @@
66
android:layout_height="match_parent"
77
tools:context=".MainActivity">
88

9-
<Button
10-
android:id="@+id/handledException"
9+
<LinearLayout
1110
android:layout_width="wrap_content"
1211
android:layout_height="wrap_content"
13-
android:onClick="handledException"
14-
android:text="Handled Exception"
15-
app:layout_constraintBottom_toTopOf="@+id/unhandledException"
16-
app:layout_constraintEnd_toEndOf="parent"
17-
app:layout_constraintHorizontal_bias="0.5"
12+
android:orientation="vertical"
13+
android:gravity="center"
14+
app:layout_constraintTop_toTopOf="parent"
15+
app:layout_constraintBottom_toBottomOf="parent"
1816
app:layout_constraintStart_toStartOf="parent"
19-
app:layout_constraintTop_toTopOf="parent" />
17+
app:layout_constraintEnd_toEndOf="parent">
2018

21-
<Button
22-
android:id="@+id/unhandledException"
23-
android:layout_width="wrap_content"
24-
android:layout_height="wrap_content"
25-
android:text="Unhandled Exception"
26-
android:onClick="unhandledException"
27-
app:layout_constraintBottom_toTopOf="@+id/nativeCrash"
28-
app:layout_constraintEnd_toEndOf="parent"
29-
app:layout_constraintHorizontal_bias="0.5"
30-
app:layout_constraintStart_toStartOf="parent"
31-
app:layout_constraintTop_toBottomOf="@+id/handledException" />
19+
<Button
20+
android:id="@+id/handledException"
21+
android:layout_width="wrap_content"
22+
android:layout_height="wrap_content"
23+
android:onClick="handledException"
24+
android:text="Handled Exception"
25+
android:layout_marginBottom="8dp" />
3226

33-
<Button
34-
android:id="@+id/nativeCrash"
35-
android:layout_width="wrap_content"
36-
android:layout_height="wrap_content"
37-
android:text="Native Crash"
38-
android:onClick="nativeCrash"
39-
app:layout_constraintBottom_toTopOf="@+id/dumpWithoutCrash"
40-
app:layout_constraintEnd_toEndOf="parent"
41-
app:layout_constraintHorizontal_bias="0.5"
42-
app:layout_constraintStart_toStartOf="parent"
43-
app:layout_constraintTop_toBottomOf="@+id/unhandledException" />
27+
<Button
28+
android:id="@+id/unhandledException"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:onClick="unhandledException"
32+
android:text="Unhandled Exception"
33+
android:layout_marginBottom="8dp" />
4434

45-
<Button
46-
android:id="@+id/dumpWithoutCrash"
47-
android:layout_width="wrap_content"
48-
android:layout_height="wrap_content"
49-
android:text="Generate sample crash report"
50-
android:onClick="dumpWithoutCrash"
51-
app:layout_constraintBottom_toTopOf="@+id/anr"
52-
app:layout_constraintEnd_toEndOf="parent"
53-
app:layout_constraintHorizontal_bias="0.5"
54-
app:layout_constraintStart_toStartOf="parent"
55-
app:layout_constraintTop_toBottomOf="@+id/nativeCrash" />
35+
<Button
36+
android:id="@+id/nativeCrash"
37+
android:layout_width="wrap_content"
38+
android:layout_height="wrap_content"
39+
android:onClick="nativeCrash"
40+
android:text="Native Crash"
41+
android:layout_marginBottom="8dp" />
5642

57-
<Button
58-
android:id="@+id/anr"
59-
android:layout_width="wrap_content"
60-
android:layout_height="wrap_content"
61-
android:text="ANR"
62-
android:onClick="anr"
63-
app:layout_constraintEnd_toEndOf="parent"
64-
app:layout_constraintHorizontal_bias="0.5"
65-
app:layout_constraintStart_toStartOf="parent"
66-
app:layout_constraintTop_toBottomOf="@+id/dumpWithoutCrash" />
43+
<Button
44+
android:id="@+id/dumpWithoutCrash"
45+
android:layout_width="wrap_content"
46+
android:layout_height="wrap_content"
47+
android:onClick="dumpWithoutCrash"
48+
android:text="Generate sample crash report"
49+
android:layout_marginBottom="8dp" />
6750

68-
<Button
69-
android:id="@+id/enableBreadcrumbs"
70-
android:layout_width="wrap_content"
71-
android:layout_height="wrap_content"
72-
android:text="Enable Breadcrumbs (All)"
73-
android:onClick="enableBreadcrumbs"
74-
app:layout_constraintEnd_toEndOf="parent"
75-
app:layout_constraintHorizontal_bias="0.5"
76-
app:layout_constraintStart_toStartOf="parent"
77-
app:layout_constraintTop_toBottomOf="@+id/anr" />
51+
<Button
52+
android:id="@+id/anr"
53+
android:layout_width="wrap_content"
54+
android:layout_height="wrap_content"
55+
android:onClick="anr"
56+
android:text="ANR"
57+
android:layout_marginBottom="8dp" />
7858

79-
<Button
80-
android:id="@+id/enableBreadcrumbsUserOnly"
81-
android:layout_width="wrap_content"
82-
android:layout_height="wrap_content"
83-
android:text="Enable Breadcrumbs (User Only)"
84-
android:onClick="enableBreadcrumbsUserOnly"
85-
app:layout_constraintEnd_toEndOf="parent"
86-
app:layout_constraintHorizontal_bias="0.5"
87-
app:layout_constraintStart_toStartOf="parent"
88-
app:layout_constraintTop_toBottomOf="@+id/enableBreadcrumbs" />
59+
<Button
60+
android:id="@+id/enableBreadcrumbs"
61+
android:layout_width="wrap_content"
62+
android:layout_height="wrap_content"
63+
android:onClick="enableBreadcrumbs"
64+
android:text="Enable Breadcrumbs (All)"
65+
android:layout_marginBottom="8dp" />
8966

90-
<Button
91-
android:id="@+id/sendReport"
92-
android:layout_width="wrap_content"
93-
android:layout_height="wrap_content"
94-
android:text="Send Report"
95-
android:onClick="sendReport"
96-
app:layout_constraintEnd_toEndOf="parent"
97-
app:layout_constraintHorizontal_bias="0.5"
98-
app:layout_constraintStart_toStartOf="parent"
99-
app:layout_constraintTop_toBottomOf="@+id/enableBreadcrumbsUserOnly" />
67+
<Button
68+
android:id="@+id/enableBreadcrumbsUserOnly"
69+
android:layout_width="wrap_content"
70+
android:layout_height="wrap_content"
71+
android:onClick="enableBreadcrumbsUserOnly"
72+
android:text="Enable Breadcrumbs (User Only)"
73+
android:layout_marginBottom="8dp" />
10074

101-
<Button
102-
android:id="@+id/disableNativeIntegration"
103-
android:layout_width="wrap_content"
104-
android:layout_height="wrap_content"
105-
android:text="Disable Native Integration"
106-
android:onClick="disableNativeIntegration"
107-
app:layout_constraintEnd_toEndOf="parent"
108-
app:layout_constraintHorizontal_bias="0.5"
109-
app:layout_constraintStart_toStartOf="parent"
110-
app:layout_constraintTop_toBottomOf="@+id/sendReport" />
75+
<Button
76+
android:id="@+id/sendReport"
77+
android:layout_width="wrap_content"
78+
android:layout_height="wrap_content"
79+
android:onClick="sendReport"
80+
android:text="Send Report"
81+
android:layout_marginBottom="8dp" />
11182

112-
<Button
113-
android:id="@+id/enableNativeIntegration"
114-
android:layout_width="wrap_content"
115-
android:layout_height="wrap_content"
116-
android:text="Re-Enable Native Integration"
117-
android:onClick="enableNativeIntegration"
118-
app:layout_constraintEnd_toEndOf="parent"
119-
app:layout_constraintHorizontal_bias="0.5"
120-
app:layout_constraintStart_toStartOf="parent"
121-
app:layout_constraintTop_toBottomOf="@+id/disableNativeIntegration" />
83+
<Button
84+
android:id="@+id/disableNativeIntegration"
85+
android:layout_width="wrap_content"
86+
android:layout_height="wrap_content"
87+
android:onClick="disableNativeIntegration"
88+
android:text="Disable Native Integration"
89+
android:layout_marginBottom="8dp" />
12290

123-
<Button
124-
android:id="@+id/exit"
125-
android:layout_width="wrap_content"
126-
android:layout_height="wrap_content"
127-
android:text="Exit"
128-
android:onClick="exit"
129-
app:layout_constraintEnd_toEndOf="parent"
130-
app:layout_constraintHorizontal_bias="0.5"
131-
app:layout_constraintStart_toStartOf="parent"
132-
app:layout_constraintTop_toBottomOf="@+id/enableNativeIntegration" />
91+
<Button
92+
android:id="@+id/enableNativeIntegration"
93+
android:layout_width="wrap_content"
94+
android:layout_height="wrap_content"
95+
android:onClick="enableNativeIntegration"
96+
android:text="Re-Enable Native Integration"
97+
android:layout_marginBottom="8dp" />
98+
99+
<Button
100+
android:id="@+id/exit"
101+
android:layout_width="wrap_content"
102+
android:layout_height="wrap_content"
103+
android:onClick="exit"
104+
android:text="Exit" />
105+
106+
</LinearLayout>
133107

134-
</androidx.constraintlayout.widget.ConstraintLayout>
108+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)