8***@qq.com
8***@qq.com
  • 发布:2024-11-28 10:12
  • 更新:2024-11-29 11:23
  • 阅读:90

【报Bug】离线SDK打包无法将统计模块SDK打入APP

分类:HTML5+

产品分类: HTML5+

HBuilderX版本号: 4.36

手机系统: Android

手机系统版本号: Android 14

手机厂商: 模拟器

手机机型: android studio

打包方式: 离线

示例代码:

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.simple">
<!-- 友盟统计 -->
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />

<application  
    android:allowBackup="true"  
    android:allowClearUserData="true"  
    android:icon="@drawable/icon"  
    android:label="@string/app_name"  
    android:largeHeap="true"  
    android:supportsRtl="true">  
    <!--  友盟统计  -->  
    <meta-data  
        android:name="UMENG_APPKEY"  
        android:value="66d536a9ecac2a664dea0089212" />  
    <meta-data  
        android:name="UMENG_CHANNEL"  
        android:value="channelid_android_keliuyi" />"  

    <activity  
        android:name="io.dcloud.PandoraEntry"  
        android:configChanges="orientation|keyboardHidden|keyboard|smallestScreenSize|navigation"  
        android:label="@string/app_name"  
        android:launchMode="singleTask"  
        android:hardwareAccelerated="true"  
        android:theme="@style/TranslucentTheme"  
        android:screenOrientation="user"  
        android:windowSoftInputMode="adjustResize" >  
        <intent-filter>  
            <action android:name="android.intent.action.MAIN" />  
            <category android:name="android.intent.category.LAUNCHER" />  
        </intent-filter>  
    </activity>  
    <activity  
        android:name="io.dcloud.PandoraEntryActivity"  
        android:launchMode="singleTask"  
        android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard|smallestScreenSize|screenLayout|screenSize|uiMode"  
        android:hardwareAccelerated="true"  
        android:permission="com.miui.securitycenter.permission.AppPermissionsEditor"  
        android:screenOrientation="user"  
        android:theme="@style/DCloudTheme"  
        android:windowSoftInputMode="adjustResize">  
        <intent-filter>  
            <category android:name="android.intent.category.DEFAULT" />  
            <category android:name="android.intent.category.BROWSABLE" />  
            <action android:name="android.intent.action.VIEW" />  
            <data android:scheme=" " />  
        </intent-filter>  
    </activity>  
    <!--  离线key  -->  
    <meta-data  
        android:name="dcloud_appkey"  
        android:value="5ffbf12a9b0e6db4f49ce06f25b00caf" />  

</application>  

</manifest>

build.gradle

apply plugin: 'com.android.application'
android {
compileSdk 30
buildToolsVersion '30.0.3'
defaultConfig {
applicationId "plus.H5F23F5A5"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
multiDexEnabled true
ndk {
abiFilters 'x86', 'armeabi-v7a', 'arm64-v8a'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
signingConfigs {
config {
keyAlias 'keliuyi'
keyPassword 'xxx'
storeFile file('/Users/hopeso/Desktop/react-ramework/projects/app-keliuyi/证书/android.keystore')
storePassword 'xxx'
v1SigningEnabled true
v2SigningEnabled true
}
}

buildTypes {  
    debug {  
        signingConfig signingConfigs.config  
        minifyEnabled false  
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'  
    }  
    release {  
        signingConfig signingConfigs.config  
        minifyEnabled false  
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'  
    }  
}  
aaptOptions {  
    additionalParameters '--auto-add-overlay'  
    ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"  
}  

}

dependencies {
implementation fileTree(dir: 'libs', include: ['.aar', '.jar'], exclude: [])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.localbroadcastmanager:localbroadcastmanager:1.0.0'
implementation 'androidx.core:core:1.1.0'
implementation "androidx.fragment:fragment:1.1.0"
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.facebook.fresco:fresco:2.5.0'
implementation "com.facebook.fresco:animated-gif:2.5.0"
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.alibaba:fastjson:1.2.83'
implementation 'androidx.webkit:webkit:1.3.0'

implementation 'com.umeng.umsdk:common:9.6.1'  
implementation 'com.umeng.umsdk:asms:1.8.0'  
implementation 'com.umeng.umsdk:abtest:1.0.1'  
implementation 'com.umeng.umsdk:apm:1.9.1'  

}

dclound_properties.xml

<properties>
<features>
<feature name="Barcode" value="io.dcloud.feature.barcode2.BarcodeFeatureImpl"/>
<feature name="Maps" value="io.dcloud.js.map.amap.JsMapPluginImpl"/>
<!--<feature name="Maps" value="io.dcloud.js.map.JsMapPluginImpl"/>-->
<feature name="Contacts" value="io.dcloud.feature.contacts.ContactsFeatureImpl"/>
<feature name="Messaging" value="io.dcloud.adapter.messaging.MessagingPluginImpl"/>
<feature name="Camera" value="io.dcloud.js.camera.CameraFeatureImpl"/>
<feature name="Console" value="io.dcloud.feature.pdr.LoggerFeatureImpl"/>
<feature name="Device" value="io.dcloud.feature.device.DeviceFeatureImpl"/>
<feature name="File" value="io.dcloud.js.file.FileFeatureImpl"/>
<feature name="Proximity" value="io.dcloud.feature.sensor.ProximityFeatureImpl"/>
<feature name="Storage" value="io.dcloud.feature.pdr.NStorageFeatureImpl"/>
<feature name="Cache" value="io.dcloud.feature.pdr.CoreCacheFeatureImpl"/>
<feature name="Invocation" value="io.dcloud.invocation.Invocation"/>
<feature name="Navigator" value="io.dcloud.feature.ui.navigator.NavigatorUIFeatureImpl"/>
<feature name="NativeUI" value="io.dcloud.feature.ui.nativeui.NativeUIFeatureImpl"/>
<feature name="UI" value="io.dcloud.feature.ui.UIFeatureImpl">
<module name="Navigator" value="io.dcloud.feature.ui.NavView"/>
</feature>
<feature name="Gallery" value="io.dcloud.js.gallery.GalleryFeatureImpl"/>
<feature name="Downloader" value="io.dcloud.net.DownloaderFeatureImpl"/>
<feature name="Uploader" value="io.dcloud.net.UploadFeature"/>
<feature name="Zip" value="io.dcloud.feature.pdr.ZipFeature"/>
<feature name="Audio" value="io.dcloud.feature.audio.AudioFeatureImpl"/>
<feature name="Runtime" value="io.dcloud.feature.pdr.RuntimeFeatureImpl"/>
<feature name="VideoPlayer" value="io.dcloud.media.MediaFeatureImpl"/>
<feature name="LivePusher" value="io.dcloud.media.live.LiveMediaFeatureImpl"/>
<feature name="XMLHttpRequest" value="io.dcloud.net.XMLHttpRequestFeature"/>
<feature name="Statistic" value="io.dcloud.feature.statistics.StatisticsFeatureImpl"/>
<feature name="Accelerometer" value="io.dcloud.feature.sensor.AccelerometerFeatureImpl"/>
<feature name="Orientation" value="io.dcloud.feature.sensor.OrientationFeatureImpl"/>
<feature name="NativeObj" value="io.dcloud.feature.nativeObj.FeatureImpl"/>
<feature name="Geolocation" value="io.dcloud.js.geolocation.GeolocationFeatureImpl"/>
<feature name="Stream" value="io.dcloud.appstream.js.StreamAppFeatureImpl"/>
<feature name="plugintest" value="com.example.H5PlusPlugin.PGPlugintest"/>
<!-- 友盟 -->
<feature name="Statistic" value="io.dcloud.feature.statistics.StatisticsFeatureImpl">
<module name="Statistic-Umeng" value="io.dcloud.feature.statistics.umeng.UmengStatistics" />
</feature>
</features>

<services>  
    <service name="push" value="io.dcloud.feature.aps.APSFeatureImpl"/>  
    <service name="Statistic" value="io.dcloud.feature.statistics.StatisticsBootImpl"/>  
    <service name="Downloader" value="io.dcloud.net.DownloaderBootImpl"/>  
    <!--<service name="Maps" value="io.dcloud.js.map.MapInitImpl"/>-->  
    <!-- 友盟 -->  
    <service name="Statistic-Umeng" value="io.dcloud.feature.statistics.umeng.StatisticsBootImpl" />  
</services>  

</properties>

操作步骤:
  1. 4.29 hbuilder 和 4.29 版本离线SDK targetSdkVersion 30 compileSdk 30
  2. 根据离线SDK文档配置 https://nativesupport.dcloud.net.cn/AppDocs/usemodule/androidModuleConfig/statistic.html 友盟统计
  3. 导出APP资源包,运行模拟器

预期结果:

将 statistic SDK 打入app中。

实际结果:

HTML5+ Runtime
statistic module was not added when packaging, please refer to httos://ask.dcloud.net.cn/article/283

bug描述:

版本信息: Hbuiderx 4.29 , 离线SDK 版本对应 4.29
目前问题:根据最新文档,配置友盟推送后模拟器运行依然显示

显示 statistic module was not added when packaging

自我已排查

  1. build.gradle 依赖已经更新
    implementation 'com.umeng.umsdk:common:9.6.1'
    implementation 'com.umeng.umsdk:asms:1.8.0'
    implementation 'com.umeng.umsdk:abtest:1.0.1'
    implementation 'com.umeng.umsdk:apm:1.9.1'
  2. AndroidManifest.xml 已配置
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />
2024-11-28 10:12 负责人:DCloud_App_Array 分享
已邀请:
DCloud_Android_zl

DCloud_Android_zl

看一下statistic-umeng-release.aar和statistic-release.aar是否都引入了

要回复问题请先登录注册