Skip to content

Commit bbf6bbb

Browse files
committed
Remove unused dependencies from native-activity.
These dependencies were not actually used but were in contradiction with the `android:hasCode=false` in the manifest. Remove the pointless dependencies, but leave some comments explaining to anyone that copies from here that they need to update `app:hasCode` if they add any DEX to their app. Fixes #929.
1 parent 6016018 commit bbf6bbb

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

native-activity/app/build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ plugins {
22
id 'com.android.application'
33
}
44

5+
// Caution: If you add any Java or Kotlin code to this project, or if you add
6+
// any dependencies which themselves use Java/Kotlin, you'll need to remove
7+
// `android:hasCode` from main/AndroidManifest.xml.
8+
59
android {
610
compileSdk 33
711
ndkVersion '25.1.8937393'
@@ -30,9 +34,3 @@ android {
3034
}
3135
namespace 'com.example.native_activity'
3236
}
33-
34-
dependencies {
35-
implementation fileTree(dir: 'libs', include: ['*.jar'])
36-
implementation 'androidx.appcompat:appcompat:1.5.1'
37-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
38-
}

native-activity/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@
44
android:versionCode="1"
55
android:versionName="1.0">
66

7-
<!-- This .apk has no Java code itself, so set hasCode to false. -->
7+
<!--
8+
This .apk has no Java/Kotlin code, so set hasCode to false.
9+
10+
If you copy from this sample and later add Java/Kotlin code, or add a
11+
dependency on a library that does (such as androidx), be sure to set
12+
`android:hasCode` to `true` (or just remove it, since that's the default).
13+
-->
814
<application
915
android:allowBackup="false"
1016
android:fullBackupContent="false"

0 commit comments

Comments
 (0)