浏览代码

update gradle and init

/unity2020
siyao 3 年前
当前提交
fcd5612b
共有 3 个文件被更改,包括 44 次插入18 次删除
  1. 24
      Assets/HuaweiService/fundation/HmsClass.cs
  2. 19
      Assets/Plugins/Android/launcherTemplate.gradle
  3. 19
      Assets/Plugins/Android/mainTemplate.gradle

24
Assets/HuaweiService/fundation/HmsClass.cs


{
string name{get;}
}
public static class AgcIniter
{
static bool needInit = true;
public static void Init(string name)
{
if (!needInit)
{
return;
}
if (name != null && name.StartsWith("com.huawei.agconnect"))
{
needInit = false;
try
{
version.LibraryInfos.getInstance().registerLibraryType("Unity");
}catch (System.Exception _)
{
}
}
}
}
public abstract class HmsClass<T> : IHmsBase where T:IHmsBaseClass, new(){
private AndroidJavaObject _obj;

}
public AndroidJavaObject obj{
get{
AgcIniter.Init(name);
return _obj == null?_obj = new AndroidJavaObject(name,HmsUtil.TransferParams(construcArgs)):_obj;
}
set{

public static AndroidJavaClass _clz;
public static AndroidJavaClass clz{
get{
AgcIniter.Init(name);
return _clz == null?_clz = new AndroidJavaClass(name):_clz;
}
}

19
Assets/Plugins/Android/launcherTemplate.gradle


dependencies {
implementation project(':unityLibrary')
implementation 'com.huawei.agconnect:agconnect-apms:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-apms-game:1.5.2.300'
implementation "com.huawei.agconnect:agconnect-storage:1.3.1.100"
implementation "com.huawei.agconnect:agconnect-appmessaging:1.4.1.300"
implementation 'com.huawei.agconnect:agconnect-applinking:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-apms:1.5.2.305'
implementation 'com.huawei.agconnect:agconnect-apms-game:1.5.2.303'
implementation "com.huawei.agconnect:agconnect-storage:1.3.1.200"
implementation "com.huawei.agconnect:agconnect-appmessaging:1.6.1.300"
implementation 'com.huawei.agconnect:agconnect-applinking:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-remoteconfig:1.6.1.300'
implementation 'com.huawei.hms:ads-lite:13.4.29.303'
implementation 'com.huawei.hms:ads-consent:3.4.30.301'
implementation 'com.huawei.hms:push:4.0.3.301'

implementation 'com.huawei.agconnect:agconnect-crash:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-core:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-function:1.4.2.300'
implementation 'com.huawei.agconnect:agconnect-crash:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-core:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-credential:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-function:1.6.1.300'
implementation 'com.huawei.hms:base:6.2.0.300'
implementation 'com.huawei.hms:hwid:6.1.0.303'
implementation 'com.huawei.hms:game:6.1.0.301'

19
Assets/Plugins/Android/mainTemplate.gradle


dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "com.huawei.agconnect:agconnect-appmessaging:1.4.1.300"
implementation "com.huawei.agconnect:agconnect-appmessaging:1.6.1.300"
implementation 'com.huawei.hms:hianalytics:5.1.0.300'
//Google
implementation 'com.google.android.gms:play-services-auth:18.1.0'

//cloud storage
implementation "com.huawei.agconnect:agconnect-storage:1.3.1.100"
implementation "com.huawei.agconnect:agconnect-storage:1.3.1.200"
implementation 'com.huawei.agconnect:agconnect-apms:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-apms-game:1.5.2.300'
implementation 'com.huawei.agconnect:agconnect-apms:1.5.2.305'
implementation 'com.huawei.agconnect:agconnect-apms-game:1.5.2.303'
//hms
implementation 'com.huawei.hms:base:6.2.0.300'

implementation 'com.huawei.agconnect:agconnect-crash:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-crash:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-core:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-auth:1.4.1.300'
implementation 'com.huawei.agconnect:agconnect-core:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-credential:1.6.1.300'
implementation 'com.huawei.agconnect:agconnect-auth:1.6.1.300'
implementation "com.huawei.agconnect:agconnect-function:1.4.2.300"
implementation "com.huawei.agconnect:agconnect-function:1.6.1.300"
implementation 'com.huawei.agconnect:agconnect-cloud-database:1.4.10.300'
implementation 'com.huawei.agconnect:agconnect-cloud-database:1.5.0.300'
**DEPS**}
android {

正在加载...
取消
保存