@@ -6,7 +6,7 @@ buildscript {
66 jcenter()
77 }
88 dependencies {
9- classpath ' com.android.tools.build:gradle:3.1.0 '
9+ classpath ' com.android.tools.build:gradle:3.2.1 '
1010 classpath ' com.google.gms:google-services:4.0.1'
1111 }
1212}
@@ -21,9 +21,6 @@ allprojects {
2121
2222apply plugin : ' com.android.application'
2323
24- // Pre-experimental Gradle plug-in NDK boilerplate below.
25- // Right now the Firebase plug-in does not work with the experimental
26- // Gradle plug-in so we're using ndk-build for the moment.
2724project. ext {
2825 // Configure the Firebase C++ SDK location.
2926 firebase_cpp_sdk_dir = System . getProperty(' firebase_cpp_sdk.dir' )
@@ -46,22 +43,11 @@ project.ext {
4643 sprintf (' Firebase C++ SDK directory %s does not exist' ,
4744 firebase_cpp_sdk_dir))
4845 }
49- // Check the NDK location using the same configuration options as the
50- // experimental Gradle plug-in.
51- ndk_dir = project. android. ndkDirectory
52- if (ndk_dir == null || ! ndk_dir. exists()) {
53- ndk_dir = System . getenv(' ANDROID_NDK_HOME' )
54- if (ndk_dir == null || ndk_dir. isEmpty()) {
55- throw new StopActionException (
56- ' Android NDK directory should be specified using the ndk.dir ' +
57- ' property or ANDROID_NDK_HOME environment variable.' )
58- }
59- }
6046}
6147
6248android {
6349 compileSdkVersion 26
64- buildToolsVersion ' 26 .0.3'
50+ buildToolsVersion ' 28 .0.3'
6551
6652 sourceSets {
6753 main {
@@ -74,11 +60,22 @@ android {
7460
7561 defaultConfig {
7662 applicationId ' com.google.android.analytics.testapp'
77- minSdkVersion 14
63+ minSdkVersion 16
7864 targetSdkVersion 26
7965 versionCode 1
8066 versionName ' 1.0'
67+ externalNativeBuild. ndkBuild {
68+ arguments " FIREBASE_CPP_SDK_DIR=${ project.ext.firebase_cpp_sdk_dir} " ,
69+ " NDK_APPLICTION_MK=jni/Application.mk" ,
70+ sprintf (" APP_PLATFORM=android-%d" ,
71+ android. defaultConfig. minSdkVersion. mApiLevel)
72+ }
73+ }
74+
75+ externalNativeBuild. ndkBuild {
76+ path ' jni/Android.mk'
8177 }
78+
8279 buildTypes {
8380 release {
8481 minifyEnabled true
@@ -91,31 +88,8 @@ android {
9188}
9289
9390dependencies {
94- compile ' com.google.firebase:firebase-core:16.0.5'
95- compile ' com.google.firebase:firebase-analytics:16.0.5'
96- compile ' com.google.firebase:firebase-common:16.0.4'
91+ implementation ' com.google.firebase:firebase-core:16.0.6'
92+ implementation ' com.google.firebase:firebase-analytics:16.0.6'
9793}
9894
9995apply plugin : ' com.google.gms.google-services'
100-
101- task ndkBuildCompile (type :Exec ) {
102- description ' Use ndk-build to compile the C++ application.'
103- commandLine(" ${ project.ext.ndk_dir}${ File.separator} ndk-build" ,
104- " FIREBASE_CPP_SDK_DIR=${ project.ext.firebase_cpp_sdk_dir} " ,
105- sprintf (" APP_PLATFORM=android-%d" ,
106- android. defaultConfig. minSdkVersion. mApiLevel))
107- }
108-
109- task ndkBuildClean (type :Exec ) {
110- description ' Use ndk-build to clean the C++ application.'
111- commandLine(" ${ project.ext.ndk_dir}${ File.separator} ndk-build" ,
112- " FIREBASE_CPP_SDK_DIR=${ project.ext.firebase_cpp_sdk_dir} " ,
113- " clean" )
114- }
115-
116- // Once the Android Gradle plug-in has generated tasks, add dependencies for
117- // the ndk-build targets.
118- project. afterEvaluate {
119- preBuild. dependsOn(ndkBuildCompile)
120- clean. dependsOn(ndkBuildClean)
121- }
0 commit comments