Pārlūkot izejas kodu

处理编译错误

zhipeng 8 mēneši atpakaļ
vecāks
revīzija
47db8342aa

+ 8 - 2
build/android/proj/gradle.properties

@@ -18,6 +18,7 @@
 # org.gradle.parallel=true
 org.gradle.jvmargs=-Xmx4608m -Dfile.encoding=UTF-8
 android.useAndroidX=true
+android.enableJetifier=true
 
 android.injected.testOnly=false
 
@@ -56,7 +57,10 @@ COCOS_ENGINE_PATH=C\:/ProgramData/cocos/editors/Creator/3.8.6/resources/resource
 RES_PATH=D:/Work/Eliminate/build/android
 
 # Native source dir
-NATIVE_DIR=D:/Work/Eliminate/native/engine/android
+NATIVE_DIR=../../../native/engine/android
+
+# Application namespace
+NAME_SPACE=com.game.eliminate
 
 # Application ID
 APPLICATION_ID=com.dingxilong.fangkuai
@@ -68,12 +72,14 @@ APPLICATION_ID=com.dingxilong.fangkuai
 PROP_APP_ABI=arm64-v8a
 
 # fill in sign information for release mode
-RELEASE_STORE_FILE=C:/ProgramData/cocos/editors/Creator/3.8.6/resources/tools/keystore/debug.keystore
+RELEASE_STORE_FILE=C\:/ProgramData/cocos/editors/Creator/3.8.6/resources/tools/keystore/debug.keystore
 RELEASE_STORE_PASSWORD=123456
 RELEASE_KEY_ALIAS=debug_keystore
 RELEASE_KEY_PASSWORD=123456
 
 
+# test channel
+test_channel=TTLZFK
 # atmob central app key
 atmob_central_app_key=aef9c479e4db48b990cd53537c2d57b1
 # gravity access token

+ 4 - 2
native/engine/android/app/AndroidManifest.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
     android:installLocation="auto">
 
     <uses-permission android:name="android.permission.INTERNET" />
@@ -8,12 +9,13 @@
 
     <application
         android:name="com.cocos.game.GameApp"
-        android:allowBackup="true"
+        android:allowBackup="false"
         android:extractNativeLibs="true"
         android:icon="@mipmap/ic_launcher"
         android:label="@string/app_name"
         android:resizeableActivity="true"
-        android:usesCleartextTraffic="true">
+        android:usesCleartextTraffic="true"
+        tools:replace="android:allowBackup">
         <meta-data
             android:name="android.app.lib_name"
             android:value="cocos" />

+ 10 - 1
native/engine/android/app/build.gradle

@@ -20,7 +20,7 @@ android {
         minSdkVersion PROP_MIN_SDK_VERSION
         targetSdkVersion PROP_TARGET_SDK_VERSION
         versionCode 1
-        versionName "1.0"
+        versionName "1.0.0"
 
         externalNativeBuild {
             cmake {
@@ -88,6 +88,7 @@ android {
 
             buildConfigField "String", "ATMOB_CENTRAL_APP_KEY", "\"$atmob_central_app_key\""
             buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
+            buildConfigField "String", "TEST_CHANNEL", "\"$test_channel\""
         }
 
         debug {
@@ -99,12 +100,20 @@ android {
 
             buildConfigField "String", "ATMOB_CENTRAL_APP_KEY", "\"$atmob_central_app_key\""
             buildConfigField "String", "GRAVITY_ACCESS_TOKEN", "\"$gravity_access_token\""
+            buildConfigField "String", "TEST_CHANNEL", "\"$test_channel\""
         }
     }
 
     buildFeatures {
         buildConfig = true
     }
+
+    configurations.configureEach {
+        resolutionStrategy {
+            // don't cache changing modules at all
+            cacheChangingModulesFor 10, 'seconds'
+        }
+    }
 }
 
 dependencies {

+ 1 - 0
native/engine/android/app/src/com/cocos/game/GameApp.java

@@ -13,6 +13,7 @@ public class GameApp extends Application {
         super.onCreate();
         AtmobCocosBridge.getInstance().init(this, new Config.Builder()
                 .debug(BuildConfig.DEBUG)
+                .testChannel(BuildConfig.TEST_CHANNEL)
                 .appKey(BuildConfig.ATMOB_CENTRAL_APP_KEY)
                 .gravityAccessToken(BuildConfig.GRAVITY_ACCESS_TOKEN)
                 .complianceStrategy(AtmobCompliance.Strategy.CHINA)