visual studio2017安装问题 :找不到与以下参数匹配的产品: channelId: VisualStudio.15.Release productId: Microsoft.Vis

由于电脑之前装过vs,所以重装vs2017的时候出现了这个问题,经网上搜索一遭,发现如下方法,简单有效。

 

解决办法:

1. 直接删除C:\ProgramData\Microsoft\VisualStudio\Packages

 2运行

C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\layout\InstallCleanup.exe -i

注意:C:\ProgramData目录,为“隐藏的项目”, 所以先需要将查看属性勾上显示隐藏文件项,就可以在c盘看到。

参考文献:https://blog.csdn.net/qq_31766907/article/details/79178995

非常抱歉,我之前的回答有误。在最新的 Android Support Library 中,`android.support.v4.media.app.NotificationCompat.MediaStyle` 已被弃用。 为了在通知中显示媒体控制按钮,您可以使用 `androidx.media.app.NotificationCompat.MediaStyle` 类。您需要确保您的项目已迁移到 AndroidX 库,并使用最新版本的 `androidx.appcompat:appcompat` 和 `androidx.media:media` 库。 以下是一个使用 `androidx.media.app.NotificationCompat.MediaStyle` 的示例代码: ```java NotificationCompat.Builder builder = new NotificationCompat.Builder(context, channelId) .setSmallIcon(R.drawable.notification_icon) .setContentTitle("音乐播放器") .setContentText("正在播放歌曲") .setStyle(new androidx.media.app.NotificationCompat.MediaStyle() .setShowActionsInCompactView(0, 1, 2) // 显示媒体控制按钮 .setMediaSession(mediaSession.getSessionToken())) .addAction(R.drawable.ic_previous, "上一曲", previousPendingIntent) .addAction(R.drawable.ic_pause, "暂停", pausePendingIntent) .addAction(R.drawable.ic_next, "下一曲", nextPendingIntent) .setPriority(NotificationCompat.PRIORITY_HIGH); NotificationManagerCompat notificationManager = NotificationManagerCompat.from(context); notificationManager.notify(notificationId, builder.build()); ``` 请确保您的项目已正确配置并引入了最新版本的 AndroidX 库。如果您仍然遇到问题,请检查您的项目配置和依赖项是否正确。如果需要进一步帮助,请随时提问!
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值