Skip to content

Commit

Permalink
Remove unused dependencies from native-activity.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DanAlbert committed Apr 17, 2024
1 parent 6016018 commit bbf6bbb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
10 changes: 4 additions & 6 deletions native-activity/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ plugins {
id 'com.android.application'
}

// Caution: If you add any Java or Kotlin code to this project, or if you add
// any dependencies which themselves use Java/Kotlin, you'll need to remove
// `android:hasCode` from main/AndroidManifest.xml.

android {
compileSdk 33
ndkVersion '25.1.8937393'
Expand Down Expand Up @@ -30,9 +34,3 @@ android {
}
namespace 'com.example.native_activity'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
}
8 changes: 7 additions & 1 deletion native-activity/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
android:versionCode="1"
android:versionName="1.0">

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

0 comments on commit bbf6bbb

Please sign in to comment.