【Android 插件化】VirtualAppEx 编译运行 ( VirtualAppEx 简介 | 配置 VirtualAppEx 编译环境 | 编译运行 VirtualAppEx 代码 )
文章目錄
- 一、VirtualAppEx 簡介
- 二、配置 VirtualAppEx 編譯環(huán)境
- 1、Android Studio 3.0
- 2、NDK 版本 ( Android NDK r10e )
- 3、配置遠(yuǎn)程倉庫
- 4、Gradle 及 Gradle 插件配置
- 三、編譯運(yùn)行 VirtualAppEx 代碼
- 四、博客源碼下載
一、VirtualAppEx 簡介
VirtualAppEx GitHub 地址 : https://github.com/xxxyanchenxxx/VirtualAppEx
xxxyanchenxxx 在 VirtualApp 2017年年底停止維護(hù)的開源代碼的基礎(chǔ)上 , 適配了 Android 9.0 操作系統(tǒng) ;
目前的 VirtualApp 的商業(yè)版本適配到了 Android 12 , 但是需要購買商業(yè)授權(quán) , 才能獲得最新代碼 ;
二、配置 VirtualAppEx 編譯環(huán)境
1、Android Studio 3.0
編譯 VirtualApp , 需要使用 Android Studio 3.0 版本的 IDE , 否則編譯會失敗 ;
參考博客 :
- 【錯(cuò)誤記錄】Android Studio 編譯報(bào)錯(cuò) ( Could not determine java version from ‘11.0.8‘. | Android Studio 降級 ) , 在該博客中 , 使用 Android Studio 4.2.1 , 報(bào)錯(cuò) Could not determine java version from '11.0.8'. ; ( 版本太高了 )
- 【錯(cuò)誤記錄】Android Studio 編譯報(bào)錯(cuò) ( This Gradle plugin requires a newer IDE able to request IDE model leve ) , 在該博客中 , 使用 Android Studio 2.3 , 報(bào)錯(cuò) Error:This Gradle plugin requires a newer IDE able to request IDE model level 3. For Android Studio this means version 3.0+ ; ( 版本太低了 )
最終使用 Android Studio 3.0 , 完成了 VirtualApp 的編譯 ;
2、NDK 版本 ( Android NDK r10e )
該項(xiàng)目在 2017 年停止維護(hù) , 使用的開發(fā)環(huán)境 , SDK , NDK 都比較老 , 這里也要使用相應(yīng)版本的環(huán)境配置 , 尤其是 NDK 比較復(fù)雜 , 如果版本使用的不對 , 直接報(bào)錯(cuò) ;
這里使用 Android NDK r10e(2015 年 5 月)的版本 ;
當(dāng)前 SDK 中已經(jīng)不支持 16 以下的 NDK 版本 ;
如果要下載老版本的 NDK , 要到 https://developer.android.google.cn/ndk/downloads/older_releases.html 頁面下載 , 下載 Android NDK r10e(2015 年 5 月)下的 Windows 64 位 android-ndk-r10e-windows-x86_64.zip 版本 ; ( 點(diǎn)擊上述鏈接也可以下載 )
下載后解壓 , 并在 local.properties 配置文件中配置 ndk 路徑 ;
ndk.dir=D\:\\001_Develop\\001_SDK\\Sdk\\ndk\\android-ndk-r10e-windows-x86_64\\android-ndk-r10e sdk.dir=D\:\\001_Develop\\001_SDK\\Sdk參考博客 【錯(cuò)誤記錄】Android Studio 編譯報(bào)錯(cuò) ( VirtualApp 編譯 NDK 報(bào)錯(cuò) | Error:A problem occurred configuring project ‘: ) ;
3、配置遠(yuǎn)程倉庫
配置遠(yuǎn)程倉庫 : 如果不配置 , 無法下載編譯所需的依賴庫 , 翻了墻也會下載失敗 ;
在根目錄下的 build.gradle 中的 buildscript.repositories 和 allprojects.repositories 中 , 添加如下兩個(gè)遠(yuǎn)程倉庫 , 否則編譯環(huán)境依賴庫下載都會出現(xiàn)問題 ;
google()mavenCentral()配置完畢后的樣式 :
// Top-level build file where you can add configuration options common to all sub-projects/modules.buildscript {repositories {jcenter()google()mavenCentral()maven {url 'https://maven.google.com/'name 'Google'}}dependencies {classpath 'com.android.tools.build:gradle:3.0.1'//classpath 'com.android.tools.build:gradle:3.2.1'classpath 'com.android.tools.build:gradle-experimental:0.11.0'// NOTE: Do not place your application dependencies here; they belong// in the individual module build.gradle files} }allprojects {repositories {jcenter()google()mavenCentral()maven {url "https://jitpack.io"}maven {url 'https://maven.google.com/'name 'Google'}} }task clean(type: Delete) {delete rootProject.buildDir }4、Gradle 及 Gradle 插件配置
Gradle 版本 4.14.14.1 ;
Gradle 插件版本 3.0.13.0.13.0.1 ;
三、編譯運(yùn)行 VirtualAppEx 代碼
按照上述編譯環(huán)境配置完成后 , 源碼編譯通過 ;
運(yùn)行效果 :
克隆一個(gè) APP ;
克隆完成 :
啟動應(yīng)用 : 銀行的 APP 居然能在插件化引擎中啟動起來 , 一點(diǎn)防范都沒有 …
四、博客源碼下載
博客源碼下載 : https://download.csdn.net/download/han1202012/33155039
總結(jié)
以上是生活随笔為你收集整理的【Android 插件化】VirtualAppEx 编译运行 ( VirtualAppEx 简介 | 配置 VirtualAppEx 编译环境 | 编译运行 VirtualAppEx 代码 )的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【错误记录】Android Studio
- 下一篇: 【Android 插件化】Virtual