|
1 | 1 | apply plugin: "com.android.application"
|
2 | 2 |
|
3 |
| -import com.android.build.OutputFile |
4 |
| - |
5 |
| -/** |
6 |
| - * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets |
7 |
| - * and bundleReleaseJsAndAssets). |
8 |
| - * These basically call `react-native bundle` with the correct arguments during the Android build |
9 |
| - * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the |
10 |
| - * bundle directly from the development server. Below you can see all the possible configurations |
11 |
| - * and their defaults. If you decide to add a configuration block, make sure to add it before the |
12 |
| - * `apply from: "../../node_modules/react-native/react.gradle"` line. |
13 |
| - * |
14 |
| - * project.ext.react = [ |
15 |
| - * // the name of the generated asset file containing your JS bundle |
16 |
| - * bundleAssetName: "index.android.bundle", |
17 |
| - * |
18 |
| - * // the entry file for bundle generation |
19 |
| - * entryFile: "index.android.js", |
20 |
| - * |
21 |
| - * // whether to bundle JS and assets in debug mode |
22 |
| - * bundleInDebug: false, |
23 |
| - * |
24 |
| - * // whether to bundle JS and assets in release mode |
25 |
| - * bundleInRelease: true, |
26 |
| - * |
27 |
| - * // whether to bundle JS and assets in another build variant (if configured). |
28 |
| - * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants |
29 |
| - * // The configuration property can be in the following formats |
30 |
| - * // 'bundleIn${productFlavor}${buildType}' |
31 |
| - * // 'bundleIn${buildType}' |
32 |
| - * // bundleInFreeDebug: true, |
33 |
| - * // bundleInPaidRelease: true, |
34 |
| - * // bundleInBeta: true, |
35 |
| - * |
36 |
| - * // whether to disable dev mode in custom build variants (by default only disabled in release) |
37 |
| - * // for example: to disable dev mode in the staging build type (if configured) |
38 |
| - * devDisabledInStaging: true, |
39 |
| - * // The configuration property can be in the following formats |
40 |
| - * // 'devDisabledIn${productFlavor}${buildType}' |
41 |
| - * // 'devDisabledIn${buildType}' |
42 |
| - * |
43 |
| - * // the root of your project, i.e. where "package.json" lives |
44 |
| - * root: "../../", |
45 |
| - * |
46 |
| - * // where to put the JS bundle asset in debug mode |
47 |
| - * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", |
48 |
| - * |
49 |
| - * // where to put the JS bundle asset in release mode |
50 |
| - * jsBundleDirRelease: "$buildDir/intermediates/assets/release", |
51 |
| - * |
52 |
| - * // where to put drawable resources / React Native assets, e.g. the ones you use via |
53 |
| - * // require('./image.png')), in debug mode |
54 |
| - * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", |
55 |
| - * |
56 |
| - * // where to put drawable resources / React Native assets, e.g. the ones you use via |
57 |
| - * // require('./image.png')), in release mode |
58 |
| - * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", |
59 |
| - * |
60 |
| - * // by default the gradle tasks are skipped if none of the JS files or assets change; this means |
61 |
| - * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to |
62 |
| - * // date; if you have any other folders that you want to ignore for performance reasons (gradle |
63 |
| - * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ |
64 |
| - * // for example, you might want to remove it from here. |
65 |
| - * inputExcludes: ["android/**", "ios/**"], |
66 |
| - * |
67 |
| - * // override which node gets called and with what additional arguments |
68 |
| - * nodeExecutableAndArgs: ["node"], |
69 |
| - * |
70 |
| - * // supply additional arguments to the packager |
71 |
| - * extraPackagerArgs: [] |
72 |
| - * ] |
73 |
| - */ |
74 |
| - |
75 | 3 | apply from: "../../node_modules/react-native/react.gradle"
|
76 | 4 |
|
77 |
| -/** |
78 |
| - * Set this to true to create two separate APKs instead of one: |
79 |
| - * - An APK that only works on ARM devices |
80 |
| - * - An APK that only works on x86 devices |
81 |
| - * The advantage is the size of the APK is reduced by about 4MB. |
82 |
| - * Upload all the APKs to the Play Store and people will download |
83 |
| - * the correct one based on the CPU architecture of their device. |
84 |
| - */ |
85 |
| -def enableSeparateBuildPerCPUArchitecture = false |
86 |
| - |
87 |
| -/** |
88 |
| - * Run Proguard to shrink the Java bytecode in release builds. |
89 |
| - */ |
90 |
| -def enableProguardInReleaseBuilds = false |
91 |
| - |
92 | 5 | android {
|
93 |
| - compileSdkVersion 23 |
94 |
| - buildToolsVersion "23.0.1" |
| 6 | + compileSdkVersion 30 |
95 | 7 |
|
96 | 8 | defaultConfig {
|
97 |
| - applicationId "com.umcomponent" |
| 9 | + applicationId "com.umeng.soexample" |
98 | 10 | minSdkVersion 16
|
99 |
| - targetSdkVersion 22 |
| 11 | + targetSdkVersion 30 |
100 | 12 | versionCode 1
|
101 | 13 | versionName "1.0"
|
102 | 14 | ndk {
|
103 | 15 | abiFilters "armeabi-v7a", "x86"
|
104 | 16 | }
|
| 17 | + manifestPlaceholders = [qqappid: "11111111111111111111"] |
105 | 18 | }
|
106 |
| - splits { |
107 |
| - abi { |
108 |
| - reset() |
109 |
| - enable enableSeparateBuildPerCPUArchitecture |
110 |
| - universalApk false // If true, also generate a universal APK |
111 |
| - include "armeabi-v7a", "x86" |
| 19 | + |
| 20 | + signingConfigs { |
| 21 | + debug { |
| 22 | + storeFile file('debug.keystore') |
| 23 | + storePassword "android" |
| 24 | + keyAlias "androiddebugkey" |
| 25 | + keyPassword "android" |
112 | 26 | }
|
113 | 27 | }
|
114 | 28 | buildTypes {
|
115 | 29 | release {
|
116 |
| - minifyEnabled enableProguardInReleaseBuilds |
117 |
| - proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" |
| 30 | + // 是否进行混淆 |
| 31 | + minifyEnabled false |
| 32 | + proguardFiles 'proguard-rules.pro' |
118 | 33 | }
|
119 |
| - } |
120 |
| - // applicationVariants are e.g. debug, release |
121 |
| - applicationVariants.all { variant -> |
122 |
| - variant.outputs.each { output -> |
123 |
| - // For each separate APK per architecture, set a unique version code as described here: |
124 |
| - // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits |
125 |
| - def versionCodes = ["armeabi-v7a":1, "x86":2] |
126 |
| - def abi = output.getFilter(OutputFile.ABI) |
127 |
| - if (abi != null) { // null for the universal-debug, universal-release variants |
128 |
| - output.versionCodeOverride = |
129 |
| - versionCodes.get(abi) * 1048576 + defaultConfig.versionCode |
130 |
| - } |
| 34 | + debug { |
| 35 | + // 是否进行混淆 |
| 36 | + minifyEnabled false |
| 37 | + proguardFiles 'proguard-rules.pro' |
131 | 38 | }
|
132 | 39 | }
|
133 | 40 | }
|
134 | 41 |
|
135 | 42 | dependencies {
|
136 |
| - compile fileTree(dir: "libs", include: ["*.jar"]) |
137 |
| - compile "com.android.support:appcompat-v7:23.0.1" |
138 |
| - compile "com.facebook.react:react-native:+" // From node_modules |
| 43 | + api fileTree(include: ['*.jar'], dir: 'libs') |
| 44 | + api 'com.android.support:appcompat-v7:28.0.0' |
| 45 | + api 'com.facebook.react:react-native:+' |
| 46 | + // From node_modules |
| 47 | + //友盟基础库(必须) |
| 48 | + api 'com.umeng.umsdk:common:9.4.4' |
| 49 | + api 'com.umeng.umsdk:asms:1.4.1' |
| 50 | + |
| 51 | + //友盟推送库 |
| 52 | + api 'com.umeng.umsdk:push:6.4.4' |
| 53 | + //如果和支付宝sdk utdid冲突,可以集成支付宝无utdid版本,或者通过以下方式解决 |
| 54 | +// api('com.umeng.umsdk:push:6.4.4') { |
| 55 | +// exclude group: 'com.umeng.umsdk', module: 'utdid' |
| 56 | +// } |
| 57 | + |
| 58 | + //分享,登录 |
| 59 | + implementation 'com.umeng.umsdk:share-core:7.1.6' |
| 60 | + implementation 'com.umeng.umsdk:share-board:7.1.6' |
| 61 | + implementation 'com.umeng.umsdk:share-qq:7.1.6' |
| 62 | + implementation 'com.umeng.umsdk:share-wx:7.1.6' |
| 63 | + implementation 'com.umeng.umsdk:share-sina:7.1.6' |
| 64 | + |
| 65 | + //新浪微博官方SDK |
| 66 | + implementation fileTree(include: ['openDefault-10.10.0.aar'], dir:'libs') |
| 67 | + //QQ官方依赖库 |
| 68 | + implementation 'com.tencent.tauth:qqopensdk:3.53.0' |
| 69 | + //微信官方依赖库 |
| 70 | + implementation 'com.tencent.mm.opensdk:wechat-sdk-android-without-mta:6.7.9' |
| 71 | + |
139 | 72 | }
|
140 | 73 |
|
141 |
| -// Run this once to be able to run the application with BUCK |
142 |
| -// puts all compile dependencies into folder libs for BUCK to use |
143 | 74 | task copyDownloadableDepsToLibs(type: Copy) {
|
144 | 75 | from configurations.compile
|
145 | 76 | into 'libs'
|
|
0 commit comments