Tencent / VasDolly

Android V1 and V2 Signature Channel Package Plugin
Other
3.07k stars 388 forks source link

Android studio3.3警告问题 #69

Closed BrightVan closed 2 years ago

BrightVan commented 5 years ago

AS 3.3会有下面的警告:

WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'.
It will be removed at the end of 2019.

自己看了下,因该是下面的代码,plugin模块,ApkChannelPackagePlugin文件:

project.afterEvaluate {
            //开始这里
            project.android.applicationVariants.all { variant ->
                def variantOutput = variant.outputs.first();
                def dirName = variant.dirName;
                def variantName = variant.name.capitalize();
                Task channelTask = project.task("channel${variantName}", type: ApkChannelPackageTask) {
                    mVariant = variant;
                    mChannelExtension = mChannelConfigurationExtension;
                    mOutputDir = new File(mChannelConfigurationExtension.baseOutputDir, dirName)
                    isMergeExtensionChannelList = !mProject.hasProperty(PROPERTY_CHANNELS)
                    channelList = mChanneInfolList
                    dependsOn variant.assemble//这里
                }
            }
        }

不知其他地方是否还用过这个api.

helixs commented 5 years ago

@BrightVan 我也遇到了和你一样的问题,我是暂时把多渠道打包的 //apply plugin: 'channel'注释掉了,具体解决方案还是要靠他们升级api方案

BrightVan commented 5 years ago

只是警告而已,能用

helixs commented 5 years ago

我这里直接是停止任务了。

BrightVan commented 5 years ago

我是可以用的,不知道是不是其他的问题。

BrightVan commented 5 years ago

额,感觉作者已经不管了。看来要自己动手,丰衣足食了。

ltlovezh commented 5 years ago

不好意思,最近实在太忙,周末我会处理下

walkthehorizon commented 5 years ago

+1, 不会影响打包,但是每次sync,make啥的都会触发警告报错,不打包的时候先移除apply:channel就行了

Speical commented 5 years ago

不会影响打包吗?我运行 gradle channelRelease命令不能打出渠道包啊

LIUPING789 commented 5 years ago

To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.

ltlovezh commented 5 years ago

我在AS3.4上咋一直碰不到这个问题呀

BrightVan commented 5 years ago

To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace.

还是有啊!

LomoLin commented 5 years ago

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getPackageLibrary(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. 除了上述的问题外,现在又多了这个问题 Android Studio3.4

LomoLin commented 5 years ago

我在AS3.4上咋一直碰不到这个问题呀

我的就是android studio3.4,除了上述的提示,还有另外一个提示

Jenus commented 5 years ago

same to me

WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

shaziln commented 5 years ago

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getPackageLibrary(), use -Pandroid.debug.obsoleteApi=true on the command line to display a stack trace. 除了上述的问题外,现在又多了这个问题 Android Studio3.4

WARNING: API 'variant.getPackageLibrary()' is obsolete and has been replaced with 'variant.getPackageLibraryProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. REASON: The Kotlin plugin is currently calling this API. We are working to solve this. WARNING: Debugging obsolete API calls can take time during configuration. It's recommended to not keep it on at all times.

kotlin的问题,降级或者等kotlin新版本解决

tangnuo commented 5 years ago

降低Gradle Plugin版本:https://blog.csdn.net/zhijiandedaima/article/details/90718376

alex-wei commented 5 years ago
    classpath 'com.android.tools.build:gradle:3.4.0'

WARNING: API 'variant.getAssemble()' is obsolete and has been replaced with 'variant.getAssembleProvider()'. It will be removed at the end of 2019. For more information, see https://d.android.com/r/tools/task-configuration-avoidance. To determine what is calling variant.getAssemble(), use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

hezhubo commented 4 years ago

年底了,这个问题还没能解决吗?

BrightVan commented 4 years ago

打包有问题的可以试下,rebuildChannel,根据安装包生成渠道包,因为同时使用了AndResGuard,所以一直是这样用的,没什么问题。目前这个插件就是用了些废弃的api,用还是可以用的。

sfy666666 commented 4 years ago

AS3.5.2也遇到了这个问题

sfy666666 commented 4 years ago

降级插件版本:https : //blog.csdn.net/zhijiandedaima/article/details/90718376

我都升级了你让我再降低 我是在找虐吗