diff --git a/app/App_Resources/Android/app.gradle b/app/App_Resources/Android/app.gradle index c40d0b3..fcd3b1f 100644 --- a/app/App_Resources/Android/app.gradle +++ b/app/App_Resources/Android/app.gradle @@ -1,22 +1,61 @@ +// Add your native dependencies here: + +// Uncomment to add recyclerview-v7 dependency // dependencies { -// compile "com.google.android.gms:play-services-base:15.0.1" +// compile 'com.android.support:recyclerview-v7:+' // } -android { +android { defaultConfig { buildToolsVersion "28.0.3" compileSdkVersion 28 generatedDensities = [] multiDexEnabled true - applicationId = "org.nativescript.curiosity" - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 28 + ndk { + abiFilters.clear() // ABI Splits related code - I need NDK 17rc1 to ensure proper ABI splits creation + } } + + // ABI Splits related code + splits { + + // Configures multiple APKs based on Applicaiton Binary Interfaces (ABI) + abi { + enable true // enables the ABIs split mechanism + reset() // Clears the default list from all ABIs to no ABIs + include 'arm64-v8a', 'armeabi-v7a', 'x86' // Spcifies a list of ABIs Gradle should createa APKs for. + universalApk true // false to skip generting the universal APK + } + } + + // ABI Splits related code + sourceSets { + main { + jniLibs.srcDirs = ["$projectDir/libs/jni", "$projectDir/snapshot-build/build/ndk-build/libs"] + } + } + + // ABI Splits related code - Different version codes (so I could upload the different splits to Google Console) + project.ext.abiCodes = ['armeabi-v7a': 1, 'arm64-v8a': 2, 'x86': 3].withDefault{0} + + android.applicationVariants.all { variant -> + variant.outputs.each { output -> + def baseAbiVersionCode = project.ext.abiCodes.get(output.getFilter("ABI"), 0) + + if (baseAbiVersionCode != null) { + output.versionCodeOverride = baseAbiVersionCode * 100000 + variant.versionCode + } + } + } + aaptOptions { additionalParameters "--no-version-vectors" } + dexOptions { jumboMode true javaMaxHeapSize "4g" } -} +} diff --git a/app/App_Resources/Android/src/main/AndroidManifest.xml b/app/App_Resources/Android/src/main/AndroidManifest.xml index c6bff55..3996261 100644 --- a/app/App_Resources/Android/src/main/AndroidManifest.xml +++ b/app/App_Resources/Android/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="27" + android:versionName="2.9.0"> { - // console.log(`Title: ${message.title}`); - // console.log(`Body: ${message.body}`); + console.log(`Title: ${message.title}`); + console.log(`Body: ${message.body}`); // if your server passed a custom property called 'foo', then do this: - // console.log(`Value of 'foo': ${message.data.foo}`); + console.log(`Value of 'foo': ${message.data.foo}`); }, - onPushTokenReceivedCallback: function (token) { - // console.log("Firebase push token: " + token); + onPushTokenReceivedCallback: (token) => { + console.log("Firebase push token: " + token); + setString("device_token", token); }, // optional but useful to immediately re-logon the user when he re-visits your app @@ -101,7 +102,7 @@ export class AppComponent implements OnInit, AfterViewInit { getCurrentPushToken().then((token: string) => { // may be null if not known yet - // console.log("Current push token: " + token); + console.log("Current push token: " + token); }); } diff --git a/package.json b/package.json index a64d5c4..60b0eff 100644 --- a/package.json +++ b/package.json @@ -5,11 +5,8 @@ "repository": "", "nativescript": { "id": "org.nativescript.curiosity", - "tns-ios": { - "version": "next" - }, "tns-android": { - "version": "next" + "version": "6.0.0-2019-06-27-141115-01" } }, "dependencies": { @@ -46,7 +43,7 @@ "mochawesome": "~3.1.2", "nativescript-dev-appium": "next", "nativescript-dev-webpack": "next", - "tns-platform-declarations": "~5.4.2", + "tns-platform-declarations": "next", "tslint": "^5.11.0", "typescript": "3.4.1" }, diff --git a/webpack.config.js b/webpack.config.js index e94ffc0..6a470f1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -308,6 +308,9 @@ module.exports = env => { ], projectRoot, webpackConfig: config, + targetArchs: ["arm", "arm64", "ia32"], + useLibs: true, + androidNdkPath: "/Library/android-sdk-macosx/ndk-bundle" })); }