本地离线打包app
uni-app本地打包apk需要提前做非常多的准备工作,并且流程复杂。官网已经给出较为详细的流程,我在这里不再赘述了(官网:nativesupport.dcloud.net.cn/AppDocs/use…
注意事项:
-
sdk要和hbuild X 的版本一
-
需要 Android平台签名证书(.keystore)生成
-
uniapp 离线打包android 高德地图 定位 uni.getLocation 就看这一篇就够了
-
需要在uniapp开发平台设置离线打包key
-
当前运行环境无法运行启用“自定义组件模式”的uni-app应用问题 以及白屏 :我们下载下来的Android SDK里有个SDK文件夹,将SDK/libs/uniapp-release.aar 文件移动到打包项目HBuilder-Hello\app\libs\下重新打包即可
-
file->Invalidate Caches/Restart.. 重新构建gradle
-
android studo不能有中文路径
-
打包后不能请求数据,需要在manifest.json开通网络请求
<uses-permission Andrandroid:name="android.permission.INTERNET" /> -
修改app名称,在AndroidManifest.xml 中
<application android:allowBackup="true" android:allowClearUserData="true" android:icon="@drawable/icon" android:label="应用名称" android:largeHeap="true" android:supportsRtl="true"> <activity android:name="io.dcloud.PandoraEntry" android:configChanges="orientation|keyboardHidden|keyboard|navigation" android:label="应用名称" 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>图标; src->main->res->drawable