Fix Protobuf gradle setup

The current setup fails to run from the command line in some
cases before the protobuf plugin is applied too early.

The correct setup is to declare the plugin as a dependency in
the high-level build.gradle file and then simply load the
plugin after initializing the shared module settings. This
matches how the Kotlin Gradle plugin is set up as well.

PiperOrigin-RevId: 837458389
This commit is contained in:
tonihei
2025-11-27 02:51:04 -08:00
committed by Copybara-Service
parent faa1628a5e
commit b7e2fe1485
2 changed files with 2 additions and 3 deletions

View File

@@ -21,6 +21,7 @@ buildscript {
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.4'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:2.0.20'
classpath 'org.jetbrains.kotlin:compose-compiler-gradle-plugin:2.0.20'
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.5'
}
}
allprojects {

View File

@@ -11,11 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
plugins {
id "com.google.protobuf" version "0.9.5"
}
apply from: "$gradle.ext.androidxMediaSettingsDir/common_library_config.gradle"
apply plugin: 'kotlin-android'
apply plugin: 'com.google.protobuf'
android {
namespace 'androidx.media3.demo.session.service'