日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

android studio怎样运行uniapp打包项目_uni app系列002:离线打包apk(2)

發布時間:2024/10/14 编程问答 28 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android studio怎样运行uniapp打包项目_uni app系列002:离线打包apk(2) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

一、用AS新建空項目

新建項目后刪除如圖說明的文件

二、AndroidManifest.xml 替換如下的application內容

三、導入uni app本地資源文件

assets, apps需要自己創建目錄

四、下載最新SDK

在 Dcloud里下載最新的SDK

下載解壓后目錄如下

HBuilder-Hello:是HelloH5打包App的示例,可以用AS打包成APKHBuilder-Integrate-AS:是HBuilder 5+ SDK 集成AS的示例SDK:是HBuilder SDK庫文件UniPlugin-Hello-AS:是開發插件并集成到Vue的示例

五、復制HBuilder-Hello項目的data到自己項目對應目錄中

六、復制HBuilder-Hello項目的libs下的三個文件到自己項目對應目錄中

六、修改配置文件

1)dcloud_control.xml

七、開始打包

1)錯誤1

AndroidManifest.xml:13:9-26:20: AAPT: error: resource style/TranslucentTheme (aka com.ntc.test.uniapp:style/TranslucentTheme) not found.

這個錯誤,需要在build.gradle(Moudle app)中增加implementation fileTree(include: ['*.aar'], dir: 'libs'),以便在打包時將libs目錄下的aar文件打包入apk

2)錯誤2

Manifest merger failed : uses-sdk:minSdkVersion 15 cannot be smaller than version 17 declared in library [android-gif-drawable-release@1.2.17.aar] C:甥敳獲Administrator.gradlecachesransforms-2files-2.1092de47bbd5688ebca77a3b9b43742bbandroid-gif-drawable-release@1.2.17AndroidManifest.xml as the library might be using APIs not available in 15

Suggestion: use a compatible library with a minSdk of at most 15,

or increase this project's minSdk version to at least 17,

or use tools:overrideLibrary="pl.droidsonroids.gif" to force usage (may lead to runtime failures)

這個錯誤,需要在build.gradle(Moudle app)中minSdkVersion改為 19

3)白屏

需要將build.gradle(Moudle app)中dependencies 換為如下

dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs') /*uniapp所需庫-----------------------開始*/ implementation 'com.android.support:recyclerview-v7:26.1.0' implementation 'com.alibaba.android:bindingx-core:1.0.3' implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.3' implementation 'com.squareup.okhttp:okhttp:2.3.0' implementation 'com.squareup.okhttp:okhttp-ws:2.3.0' implementation 'com.alibaba:fastjson:1.1.46.android' implementation 'com.facebook.fresco:fresco:1.13.0' implementation "com.facebook.fresco:animated-gif:1.13.0" /*uniapp所需庫-----------------------結束*/}

4)打出的包有20多M

需要在build.gradle(Moudle app)中defaultConfig下增加

ndk { abiFilters 'x86','armeabi-v7a'}

增加后打出的包有16多M

八、完整的build.gradle(Moudle app)

apply plugin: 'com.android.application'android { compileSdkVersion 29 defaultConfig { applicationId "com.ntc.test.myapplication" minSdkVersion 19 targetSdkVersion 29 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" ndk { abiFilters 'x86','armeabi-v7a' } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' } }}dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') implementation fileTree(include: ['*.aar'], dir: 'libs') /*uniapp所需庫-----------------------開始*/ implementation 'com.android.support:recyclerview-v7:26.1.0' implementation 'com.alibaba.android:bindingx-core:1.0.3' implementation 'com.alibaba.android:bindingx_weex_plugin:1.0.3' implementation 'com.squareup.okhttp:okhttp:2.3.0' implementation 'com.squareup.okhttp:okhttp-ws:2.3.0' implementation 'com.alibaba:fastjson:1.1.46.android' implementation 'com.facebook.fresco:fresco:1.13.0' implementation "com.facebook.fresco:animated-gif:1.13.0" /*uniapp所需庫-----------------------結束*/}

總結

以上是生活随笔為你收集整理的android studio怎样运行uniapp打包项目_uni app系列002:离线打包apk(2)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。