蓝灯App的编译过程可以说非常非常困难!用艰苦卓绝来形容都不足未过。我是花了一天半的时间才研究出来,其中遇到的问题几乎无法解决,都是绞尽了脑汁才想出了办法,可是最后卡在最后一步硬是无法解决,今天灵感突然一闪,终于解决了!
下面是我刚刚编译出来的蓝灯安卓APP:
https://copy.com/2RmTo0xmNNJq7iER/lantern-debug.apk?download=1顺便吐槽一下:蓝灯官方的app编译文档写的真是太烂了,用垃圾来形容都不足为过,编译的文件出了那么多bug,尼玛完全不修正,害的我尼玛想尽办法去修正,发了issue也不回,屌JB啊!
我现在终于理解了XX-NET在开发手机端一直没有进展的原因了。安卓的编译真的是很不简单,非常有难度!
所以,关于蓝灯App的编译方法,不是我不愿意讲, 是担心讲了你也承受不了。
编译成功的过程是这样的:
#make android-lib
** VERSION was not set, using default version. This is OK while in development.
Build tags:
Extra ldflags:
root@gary-To-be-filled-by-O-E-M:/home/gary/lantern# make android-sdk
mkdir -p MobileSDK/sdk/libs/ && \
cp liblantern.aar MobileSDK/sdk/libs//liblantern.aar
(cd MobileSDK && gradle assembleDebug)
:sdk:preBuild UP-TO-DATE
:sdk:preDebugBuild UP-TO-DATE
:sdk:compileDebugNdk UP-TO-DATE
:sdk:compileLint
:sdk:copyDebugLint UP-TO-DATE
:sdk:checkDebugManifest
:sdk:preDebugAndroidTestBuild UP-TO-DATE
:sdk:preDebugUnitTestBuild UP-TO-DATE
:sdk:preReleaseBuild UP-TO-DATE
:sdk:preReleaseUnitTestBuild UP-TO-DATE
:sdk:prepareComAndroidSupportAppcompatV72311Library UP-TO-DATE
:sdk:prepareComAndroidSupportSupportV42311Library UP-TO-DATE
:sdk:prepareComGoogleAndroidGmsPlayServicesAnalytics700Library UP-TO-DATE
:sdk:prepareComGoogleAndroidGmsPlayServicesBase700Library UP-TO-DATE
:sdk:prepareLiblanternLibrary
:sdk:prepareDebugDependencies
:sdk:compileDebugAidl UP-TO-DATE
:sdk:compileDebugRenderscript UP-TO-DATE
:sdk:generateDebugBuildConfig UP-TO-DATE
:sdk:generateDebugAssets UP-TO-DATE
:sdk:mergeDebugAssets UP-TO-DATE
:sdk:generateDebugResValues UP-TO-DATE
:sdk:generateDebugResources UP-TO-DATE
:sdk:mergeDebugResources UP-TO-DATE
:sdk:processDebugManifest UP-TO-DATE
:sdk:processDebugResources UP-TO-DATE
:sdk:generateDebugSources UP-TO-DATE
:sdk:compileDebugJavaWithJavac UP-TO-DATE
:sdk:extractDebugAnnotations UP-TO-DATE
:sdk:mergeDebugProguardFiles UP-TO-DATE
:sdk:packageDebugRenderscript UP-TO-DATE
:sdk:packageDebugResources UP-TO-DATE
:sdk:processDebugJavaRes UP-TO-DATE
:sdk:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:sdk:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:sdk:mergeDebugJniLibFolders UP-TO-DATE
:sdk:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:sdk:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:sdk:bundleDebug
:sdk:compileDebugSources UP-TO-DATE
:sdk:assembleDebug
BUILD SUCCESSFUL
Total time: 11.411 secs
This build could be faster, please consider using the Gradle Daemon:
https://docs.gradle.org/2.12/userguide/gradle_daemon.html
root@gary-To-be-filled-by-O-E-M:/home/gary/lantern# make android-debug
make[1]: Entering directory '/home/gary/lantern/src/
github.com/getlantern/lantern-mobile'
[armeabi] Install : libtun2socks.so => libs/armeabi/libtun2socks.so
[armeabi-v7a] Install : libtun2socks.so => libs/armeabi-v7a/libtun2socks.so
[x86] Install : libtun2socks.so => libs/x86/libtun2socks.so
make[1]: Leaving directory '/home/gary/lantern/src/
github.com/getlantern/lantern-mobile'
WARNING:
Dependency org.apache.httpcomponents:httpclient:4.2.3 is ignored for
debug as it may be conflicting with the internal version provided by
Android.
In case of problem, please repackage it with jarjar to change the class packages
WARNING:
Dependency org.apache.httpcomponents:httpclient:4.2.3 is ignored for
release as it may be conflicting with the internal version provided by
Android.
In case of problem, please repackage it with jarjar to change the class packages
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72301Library
:app:prepareComAndroidSupportSupportV42301Library
:app:prepareComCrashlyticsSdkAndroidAnswers134Library
:app:prepareComCrashlyticsSdkAndroidBeta114Library
:app:prepareComCrashlyticsSdkAndroidCrashlytics253Library
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore236Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics700Library
:app:prepareComGoogleAndroidGmsPlayServicesBase700Library
:app:prepareIoFabricSdkAndroidFabric138Library
:app:prepareLiblanternLibrary
:app:prepareSdkDebugLibrary
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:processDebugManifest
:app:fabricGenerateResourcesDebug
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJavaWithJavac
注:
/home/gary/lantern/src/github.com/getlantern/lantern-mobile/app/src/main
/java/org/getlantern/lantern/activity/LanternMainActivity.java使用或覆盖了已过时的
API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:transformClassesWithDexForDebug
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
BUILD SUCCESSFUL
Total time: 1 mins 47.385 secs
This build could be faster, please consider using the Gradle Daemon:
https://docs.gradle.org/2.12/userguide/gradle_daemon.html

在 2016年3月24日星期四 UTC+8上午2:20:28,
wwaa...@gmail.com写道: