Tencent / tinker

Tinker is a hot-fix solution library for Android, it supports dex, library and resources update without reinstall apk.
Other
17.17k stars 3.34k forks source link

tinker application demo可以创建成功 但是集成到项目中不能创建成功 #608

Closed yangyangforcoding closed 7 years ago

yangyangforcoding commented 7 years ago

异常类型:app运行时异常/编译异常

tinker版本:1.8.0

gradle版本:4.0-milestone-1

是否使用热更新SDK: 如 TinkerPatch SDK 或者 Bugly SDK

系统:windows7

demo可以正常创建成功:下面是demo的build日志 * 注: Creating file:/E:/Demo/TinkerDemo/app/build/generated/source/apt/release/com/lalamove/huolala/tinkerdemo/SimpleApplication.java 注: 某些输入文件使用或覆盖了已过时的 API。 注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。

=====================================

集成到公司的项目的时候就不可以了:下面是项目的build日志

WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for debug WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for debug WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for release WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for release WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for defaultConfig WARNING: Ignoring Android API artifact com.google.android:android:4.1.1.4 for defaultConfig Jack is disabled, but one of the plugins you are using supports Java 8 language features. The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use the method ConfigurableReport.setDestination(File) instead. Jack is disabled, but one of the plugins you are using supports Java 8 language features. Jack is disabled, but one of the plugins you are using supports Java 8 language features. ----------------------tinker build warning ------------------------------------ tinker auto operation: excluding annotation processor and source template from app packaging. Enable dx jumboMode to reduce package size. enable dx jumboMode to reduce package size. disable preDexLibraries to prevent ClassDefNotFoundException when your app is booting.

tinker will change your build configs: we will add TINKER_ID=HllTinkerId in your build output manifest file build/intermediates/manifests/full/*

if minifyEnabled is true you will find the gen proguard rule file at build/intermediates/tinker_intermediates/tinker_proguard.pro and we will help you to put it in the proguardFiles.

if multiDexEnabled is true you will find the gen multiDexKeepProguard file at build/intermediates/tinker_intermediates/tinker_multidexkeep.pro and we will help you to put it in the MultiDexKeepProguardFile.

if applyResourceMapping file is exist we will build app apk with resource R.txt file if resources.arsc has changed, you should use applyResource mode to build the new apk!

:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preDefaultConfigBuild UP-TO-DATE :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAnimatedVectorDrawable2501Library :app:prepareComAndroidSupportAppcompatV72501Library :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareComAndroidSupportMultidex101Library :app:prepareComAndroidSupportRecyclerviewV72501Library :app:prepareComAndroidSupportSupportCompat2501Library :app:prepareComAndroidSupportSupportCoreUi2501Library :app:prepareComAndroidSupportSupportCoreUtils2501Library :app:prepareComAndroidSupportSupportFragment2501Library :app:prepareComAndroidSupportSupportMediaCompat2501Library :app:prepareComAndroidSupportSupportV42501Library :app:prepareComAndroidSupportSupportVectorDrawable2501Library :app:prepareComNispokSnackbar2102Library :app:prepareComTencentTinkerTinkerAndroidLib180Library :app:prepareComTencentTinkerTinkerAndroidLoader180Library :app:prepareFrAvianeyComViewpagerindicatorLibrary241Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:generateDebugResValues :app:generateDebugResources :app:mergeDebugResources :app:processDebugManifest E:\company\huolalaDriverTinker\app\src\main\AndroidManifest.xml:65:5-78 Warning: Element uses-permission#android.permission.SYSTEM_ALERT_WINDOW at AndroidManifest.xml:65:5-78 duplicated with element declared at AndroidManifest.xml:37:5-78 :app:tinkerProcessDebugManifest tinker add tinker_id_HllTinkerId to your AndroidManifest.xml E:\company\huolalaDriverTinker\app\build\intermediates\manifests\full\debug\AndroidManifest.xml tinker add com.lalamove.huolala.driver.HllApplication to dex loader pattern tinker add com.tencent.tinker.loader.* to dex loader pattern tinker gen AndroidManifest.xml in build/intermediates/tinker_intermediates/AndroidManifest.xml :app:tinkerProcessDebugResourceId apply resource mapping file E:\company\huolalaDriverTinker\app\build\bakApk/app-debug-0914-16-49-24-R.txt is illegal, just ignore :app:processDebugResources :app:generateDebugSources :app:incrementalDebugJavaCompilationSafeguard UP-TO-DATE :app:javaPreCompileDebug :app:compileDebugJavaWithJavac UP-TO-DATE :app:compileDebugNdk NO-SOURCE :app:compileDebugSources UP-TO-DATE :app:mergeDebugShaders UP-TO-DATE :app:compileDebugShaders UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets UP-TO-DATE :app:transformClassesWithRetrolambdaForDebug UP-TO-DATE :app:transformClassesWithJarMergingForDebug UP-TO-DATE :app:tinkerProcessDebugMultidexKeep try update tinker multidex keep proguard file with E:\company\huolalaDriverTinker\app\build\intermediates\tinker_intermediates\tinker_multidexkeep.pro :app:transformClassesWithMultidexlistForDebug :app:transformClassesWithDexForDebug UP-TO-DATE :app:mergeDebugJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE :app:transformNativeLibsWithStripDebugSymbolForDebug UP-TO-DATE :app:processDebugJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE :app:validateSigningDebug :app:packageDebug :app:assembleDebug :app:checkDefaultConfigManifest :app:prepareDefaultConfigDependencies :app:compileDefaultConfigAidl UP-TO-DATE :app:compileDefaultConfigRenderscript UP-TO-DATE :app:generateDefaultConfigBuildConfig UP-TO-DATE :app:generateDefaultConfigResValues UP-TO-DATE :app:generateDefaultConfigResources UP-TO-DATE :app:mergeDefaultConfigResources UP-TO-DATE :app:processDefaultConfigManifest E:\company\huolalaDriverTinker\app\src\main\AndroidManifest.xml:65:5-78 Warning: Element uses-permission#android.permission.SYSTEM_ALERT_WINDOW at AndroidManifest.xml:65:5-78 duplicated with element declared at AndroidManifest.xml:37:5-78 :app:tinkerProcessDefaultConfigManifest tinker add tinker_id_HllTinkerId to your AndroidManifest.xml E:\company\huolalaDriverTinker\app\build\intermediates\manifests\full\defaultConfig\AndroidManifest.xml tinker gen AndroidManifest.xml in build/intermediates/tinker_intermediates/AndroidManifest.xml :app:tinkerProcessDefaultConfigResourceId apply resource mapping file E:\company\huolalaDriverTinker\app\build\bakApk/app-debug-0914-16-49-24-R.txt is illegal, just ignore :app:processDefaultConfigResources :app:generateDefaultConfigSources :app:incrementalDefaultConfigJavaCompilationSafeguard UP-TO-DATE :app:javaPreCompileDefaultConfig :app:compileDefaultConfigJavaWithJavac UP-TO-DATE :app:compileDefaultConfigNdk NO-SOURCE :app:compileDefaultConfigSources UP-TO-DATE :app:mergeDefaultConfigShaders UP-TO-DATE :app:compileDefaultConfigShaders UP-TO-DATE :app:generateDefaultConfigAssets UP-TO-DATE :app:mergeDefaultConfigAssets UP-TO-DATE :app:transformClassesWithRetrolambdaForDefaultConfig UP-TO-DATE :app:transformClassesWithJarMergingForDefaultConfig UP-TO-DATE :app:tinkerProcessDefaultConfigMultidexKeep try update tinker multidex keep proguard file with E:\company\huolalaDriverTinker\app\build\intermediates\tinker_intermediates\tinker_multidexkeep.pro :app:transformClassesWithMultidexlistForDefaultConfig :app:transformClassesWithDexForDefaultConfig UP-TO-DATE :app:mergeDefaultConfigJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForDefaultConfig UP-TO-DATE :app:transformNativeLibsWithStripDebugSymbolForDefaultConfig UP-TO-DATE :app:processDefaultConfigJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForDefaultConfig UP-TO-DATE :app:packageDefaultConfig :app:assembleDefaultConfig :app:checkReleaseManifest :app:prepareReleaseDependencies :app:compileReleaseAidl UP-TO-DATE :app:compileReleaseRenderscript UP-TO-DATE :app:generateReleaseBuildConfig UP-TO-DATE :app:generateReleaseResValues UP-TO-DATE :app:generateReleaseResources UP-TO-DATE :app:mergeReleaseResources UP-TO-DATE :app:processReleaseManifest E:\company\huolalaDriverTinker\app\src\main\AndroidManifest.xml:65:5-78 Warning: Element uses-permission#android.permission.SYSTEM_ALERT_WINDOW at AndroidManifest.xml:65:5-78 duplicated with element declared at AndroidManifest.xml:37:5-78 :app:tinkerProcessReleaseManifest tinker add tinker_id_HllTinkerId to your AndroidManifest.xml E:\company\huolalaDriverTinker\app\build\intermediates\manifests\full\release\AndroidManifest.xml tinker gen AndroidManifest.xml in build/intermediates/tinker_intermediates/AndroidManifest.xml :app:tinkerProcessReleaseResourceId apply resource mapping file E:\company\huolalaDriverTinker\app\build\bakApk/app-debug-0914-16-49-24-R.txt is illegal, just ignore :app:processReleaseResources :app:generateReleaseSources :app:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE :app:javaPreCompileRelease :app:compileReleaseJavaWithJavac UP-TO-DATE :app:compileReleaseNdk NO-SOURCE :app:compileReleaseSources UP-TO-DATE :app:mergeReleaseShaders UP-TO-DATE :app:compileReleaseShaders UP-TO-DATE :app:generateReleaseAssets UP-TO-DATE :app:mergeReleaseAssets UP-TO-DATE :app:transformClassesWithRetrolambdaForRelease UP-TO-DATE :app:transformClassesWithJarMergingForRelease UP-TO-DATE :app:tinkerProcessReleaseMultidexKeep try update tinker multidex keep proguard file with E:\company\huolalaDriverTinker\app\build\intermediates\tinker_intermediates\tinker_multidexkeep.pro :app:transformClassesWithMultidexlistForRelease :app:transformClassesWithDexForRelease UP-TO-DATE :app:mergeReleaseJniLibFolders UP-TO-DATE :app:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE :app:transformNativeLibsWithStripDebugSymbolForRelease UP-TO-DATE :app:processReleaseJavaRes NO-SOURCE :app:transformResourcesWithMergeJavaResForRelease UP-TO-DATE :app:validateSigningRelease :app:packageRelease :app:assembleRelease :app:assemble :app:lint Ran lint on variant debug: 1318 issues found Ran lint on variant release: 1318 issues found Ran lint on variant defaultConfig: 1318 issues found Wrote HTML report to file:///E:/company/huolalaDriverTinker/app/build/reports/lint-results.html Wrote XML report to file:///E:/company/huolalaDriverTinker/app/build/reports/lint-results.xml :app:incrementalDebugUnitTestJavaCompilationSafeguard NO-SOURCE :app:javaPreCompileDebugUnitTest :app:preDebugUnitTestBuild UP-TO-DATE :app:prepareDebugUnitTestDependencies :app:compileDebugUnitTestJavaWithJavac NO-SOURCE :app:processDebugUnitTestJavaRes NO-SOURCE :app:compileDebugUnitTestSources UP-TO-DATE :app:mockableAndroidJar :app:assembleDebugUnitTest :app:testDebugUnitTest NO-SOURCE :app:incrementalDefaultConfigUnitTestJavaCompilationSafeguard NO-SOURCE :app:javaPreCompileDefaultConfigUnitTest :app:preDefaultConfigUnitTestBuild UP-TO-DATE :app:prepareDefaultConfigUnitTestDependencies :app:compileDefaultConfigUnitTestJavaWithJavac NO-SOURCE :app:processDefaultConfigUnitTestJavaRes NO-SOURCE :app:compileDefaultConfigUnitTestSources UP-TO-DATE :app:assembleDefaultConfigUnitTest :app:testDefaultConfigUnitTest NO-SOURCE :app:incrementalReleaseUnitTestJavaCompilationSafeguard NO-SOURCE :app:javaPreCompileReleaseUnitTest :app:preReleaseUnitTestBuild UP-TO-DATE :app:prepareReleaseUnitTestDependencies :app:compileReleaseUnitTestJavaWithJavac NO-SOURCE :app:processReleaseUnitTestJavaRes NO-SOURCE :app:compileReleaseUnitTestSources UP-TO-DATE :app:assembleReleaseUnitTest :app:testReleaseUnitTest NO-SOURCE :app:test UP-TO-DATE :app:check :app:build

                                                                                                                              希望作者能给予我帮助
                                                                                                                                                        谢谢!
simpleton commented 7 years ago

暂时还不能支持gradle 4.+的版本,可以使用gradle3.3和build tools 2.x的版本 ref #495

yangyangforcoding commented 7 years ago

@simpleton 我的两个项目gradle 版本和 build tools 版本都是一样的 并且代码也是我从demo中拷贝到我的项目里面的 。我上面的日志并不是报错的日志 ,是我在demo的build时候会打印application创建了 但是我公司的项目build的时候没有打印出这个application创建的日志