用uniapp打包出一个跨端app!
目录
使用uniapp在macOS 10.15.6上打包安卓离线App
创建之后目录如下所示:
在hubilder离线sdk里面找到sdk/libs文件夹
将lib.5plus.base-release.aar、android-gif-drawable-release@1.2.17.aar、uniapp-release.aar和miit_mdid_1.0.10.aar(HBuilderX2.8.1之后更新到msa_mdid_1.0.13.aar)拷贝到libs目录下
在build.gradle里面添加资源引用
同时uniapp也需要添加这个:
删掉这个mainactivity节点
然后把这个给加进去
<activity
android:name="io.dcloud.PandoraEntry"
android:configChanges="orientation|keyboardHidden|keyboard|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"
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="h56131bcf" />
</intent-filter>
</activity>
<!--provider节点必须添加-->
<provider
android:name="io.dcloud.common.util.DCloud_FileProvider"
android:authorities="${apk.applicationId}.dc.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/dcloud_file_provider" />
</provider>
创建assets
把离线sdk的 assets/data 拷贝到assets中

用hbuilder导出资源
复制到assets/apps里面
修改dcloud_control.xml文件
Caused by: org.gradle.internal.service.ServiceCreationException: Could not create service of type OutputFilesRepository using ExecutionGradleServices.createOutputFilesRepository().
Caused by: org.gradle.cache.LockTimeoutException: Timeout waiting to lock Build Output Cleanup Cache (/Volumes/PERSON/union_app/static-template-andorid/.gradle/buildOutputCleanup). It is currently in use by another Gradle instance.