diff --git a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java index d07ec86..69052b9 100644 --- a/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java +++ b/cocos/platform/android/java/src/org/cocos2dx/lib/Cocos2dxActivity.java @@ -36,11 +36,10 @@ import android.os.Bundle; import android.os.Message; import android.os.PowerManager; import android.preference.PreferenceManager.OnActivityResultListener; -import android.support.v4.content.ContextCompat; +import androidx.core.content.ContextCompat; import android.util.Log; import android.view.View; import android.view.ViewGroup; -import android.view.Window; import android.view.WindowManager; import android.net.Uri; import android.provider.Settings; diff --git a/cocos/platform/android/libcocos2dx/build.gradle b/cocos/platform/android/libcocos2dx/build.gradle index 30c0b15..37022c1 100644 --- a/cocos/platform/android/libcocos2dx/build.gradle +++ b/cocos/platform/android/libcocos2dx/build.gradle @@ -28,5 +28,5 @@ android { dependencies { implementation fileTree(dir: '../java/libs', include: ['*.jar']) - implementation 'com.android.support:support-v4:26.1.0' + implementation 'androidx.legacy:legacy-support-v4:1.0.0' } diff --git a/templates/frameworks/runtime-src/proj.android/build.gradle b/templates/frameworks/runtime-src/proj.android/build.gradle index f4b5d49..6ad59ec 100644 --- a/templates/frameworks/runtime-src/proj.android/build.gradle +++ b/templates/frameworks/runtime-src/proj.android/build.gradle @@ -4,11 +4,11 @@ buildscript { repositories { google() //jcenter() - maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} + maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'} } dependencies { - classpath 'com.android.tools.build:gradle:4.2.1' + classpath 'com.android.tools.build:gradle:7.3.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files @@ -19,7 +19,7 @@ allprojects { repositories { google() // jcenter() - maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'} + maven{ url 'https://maven.aliyun.com/nexus/content/groups/public/'} } } diff --git a/templates/frameworks/runtime-src/proj.android/gradle.properties b/templates/frameworks/runtime-src/proj.android/gradle.properties index 9966f54..0336df4 100644 --- a/templates/frameworks/runtime-src/proj.android/gradle.properties +++ b/templates/frameworks/runtime-src/proj.android/gradle.properties @@ -36,7 +36,7 @@ PROP_NDK_VERSION=20.1.5948944 # Available architextures (armeabi-v7a | arm64-v8a | x86) # To build for multiple architexture, use the `:` between them # Example - PROP_APP_ABI=armeabi-v7a:arm64-v8a:x86 -PROP_APP_ABI=armeabi-v7a +PROP_APP_ABI=arm64-v8a # uncomment it and fill in sign information for release mode #RELEASE_STORE_FILE=file path of keystore @@ -44,4 +44,6 @@ PROP_APP_ABI=armeabi-v7a #RELEASE_KEY_ALIAS=alias of key #RELEASE_KEY_PASSWORD=password of key -android.injected.testOnly=false \ No newline at end of file +android.injected.testOnly=false +android.useAndroidX=true +android.enableJetifier=true diff --git a/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties b/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties index e62e8bd..30d1b3e 100644 --- a/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties +++ b/templates/frameworks/runtime-src/proj.android/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip