HbuilderX 用android studio 本地打包app
程序员文章站
2024-01-24 18:04:46
...
新建MUI项目
生成本地资源包
android studio新建No acticity项目
切换至project模式
把下载的SDK文件中的libs目录下的 lib.5plus.base-release.aar 文件拷贝到项目下的的libs目录下
修改build.gradle文件,在dependencies 下新增依赖 implementation fileTree(dir: ‘libs’, include: [’*.aar’])
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
applicationId "com.example.start"
minSdkVersion 15
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation fileTree(dir: 'libs', include: ['*.aar'])
implementation 'androidx.appcompat:appcompat:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}
在AndroidMainfest.xml中的application标签中两个activity标签,内容如下
<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>
在src/main下新建文件夹assets与java文件夹同级,将SDK下的assets下data目录拷贝至src/main/assets目录下
在assets下新建apps目录,然后将HbuilderX生成的打包文件拷贝至apps目录下
assets下的目录结构必须是apps/APPID/www/,并且修改data/dcloud_control.xml的appid的值,保持和包名字一致
上一篇: Python --入门小程序
推荐阅读
-
HbuilderX 用android studio 本地打包app
-
Android studio 多渠道开发App以及打包方法
-
Android Studio 使用Gradle创建远程本地仓库,解决打包AAR包时丢失所有dependencies库
-
Unity上线google商店 用IL2Cpp打包64位版本和Android APP Bundle优化 及产生的bug
-
用HTML5来开发一款android本地化App游戏-宝石碰碰
-
android studio 将APP打包成横屏
-
用HTML5来开发一款android本地化App游戏-宝石碰碰
-
Android studio 多渠道开发App以及打包方法
-
用HBuilderX 打包 vue 项目 为 App 的步骤
-
Unity上线google商店 用IL2Cpp打包64位版本和Android APP Bundle优化 及产生的bug