- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
AppBarLayout
有问题。
更新:这是一个新错误。 XML View 预览不显示任何内容。普通的设计 View 显示预览,但无法点击任何内容。
java.lang.IllegalArgumentException: object is not an instance of declaring class
这里是错误:
java.lang.IllegalArgumentException: java.lang.ClassCastException@24bbb842
at sun.reflect.GeneratedMethodAccessor319.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at android.animation.PropertyValuesHolder_Delegate.callMethod(PropertyValuesHolder_Delegate.java:108)
at android.animation.PropertyValuesHolder_Delegate.nCallFloatMethod(PropertyValuesHolder_Delegate.java:143)
at android.animation.PropertyValuesHolder.nCallFloatMethod(PropertyValuesHolder.java)
at android.animation.PropertyValuesHolder.access$400(PropertyValuesHolder.java:38)
at android.animation.PropertyValuesHolder$FloatPropertyValuesHolder.setAnimatedValue(PropertyValuesHolder.java:1387)
at android.animation.ObjectAnimator.animateValue(ObjectAnimator.java:990)
at android.animation.ValueAnimator.setCurrentFraction(ValueAnimator.java:674)
at android.animation.ValueAnimator.setCurrentPlayTime(ValueAnimator.java:637)
at android.animation.ValueAnimator.start(ValueAnimator.java:1069)
at android.animation.ValueAnimator.start(ValueAnimator.java:1088)
at android.animation.ObjectAnimator.start(ObjectAnimator.java:852)
at android.animation.StateListAnimator.start(StateListAnimator.java:188)
at android.animation.StateListAnimator.setState(StateListAnimator.java:181)
at android.view.View.drawableStateChanged(View.java:21105)
at android.view.ViewGroup.drawableStateChanged(ViewGroup.java:7101)
at com.google.android.material.appbar.AppBarLayout.drawableStateChanged(AppBarLayout.java:393)
at android.view.View.refreshDrawableState(View.java:21160)
at android.view.View.dispatchAttachedToWindow(View.java:18379)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3397)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:3404)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:42)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:335)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:391)
at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:195)
at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:540)
at com.android.tools.idea.rendering.RenderTask.lambda$inflate$5(RenderTask.java:666)
at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
这是我的 XML:
<androidx.coordinatorlayout.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:theme="@style/ToolbarWhiteText"
app:logo="@drawable/vector_logo">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="24dp"
android:gravity="start|center_vertical"
android:text="@string/title_profile"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="@color/white"
android:textSize="16sp"
android:textStyle="bold" />
</androidx.appcompat.widget.Toolbar>
</com.google.android.material.appbar.AppBarLayout>
Gradle 依赖项(我知道它们很多)
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
// Core
implementation 'androidx.appcompat:appcompat:1.1.0-alpha05'
implementation 'com.google.android.material:material:1.1.0-alpha06'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
implementation 'androidx.recyclerview:recyclerview:1.1.0-alpha05'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
// Google
implementation "com.google.android.gms:play-services-location:$playServicesVersion"
implementation "com.google.android.gms:play-services-places:$playServicesVersion"
implementation "com.google.android.gms:play-services-maps:$playServicesVersion"
implementation "com.google.android.gms:play-services-auth:$playServicesVersion"
implementation 'com.google.firebase:firebase-core:16.0.8'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation "com.google.firebase:firebase-messaging:$firebaseMessagingVersion"
implementation "com.google.maps:google-maps-services:$googleMapServicesVersion"
// Retrofit and Moshi
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-moshi:$retrofitVersion"
// Butterknife
implementation "com.jakewharton:butterknife:$butterknifeVersion"
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta1'
annotationProcessor "com.jakewharton:butterknife-compiler:$butterknifeVersion"
// EasyPermissions
implementation "pub.devrel:easypermissions:$easyPermissionsVersion"
// Toasty
implementation "com.github.GrenderG:Toasty:$toastyVersion"
// CardIO
/*implementation "io.card:android-sdk:$cardIoVersion"*/
// MaterialDialog
implementation "com.afollestad.material-dialogs:core:$materialDialogsVersion"
// Material Drawer
implementation("com.mikepenz:materialdrawer:$materialDrawerVersion") { transitive = true }
implementation 'androidx.annotation:annotation:1.1.0-rc01'
// NiceSpinner
implementation "com.github.arcadefire:nice-spinner:$niceSpinnerVersion"
// Circle ImageView
implementation "de.hdodenhof:circleimageview:$circleImageViewVersion"
// Socket.IO
implementation("io.socket:socket.io-client:$socketIOVersion") {
exclude group: 'org.json', module: 'json'
}
implementation "com.dinuscxj:circleprogressbar:$circularProgressVersion"
implementation("com.wdullaer:materialdatetimepicker:$materialDateTimeVersion") {
exclude group: 'androidx.appcompat'
exclude group: 'androidx.recyclerview'
}
implementation "com.azoft.carousellayoutmanager:carousel:$carouselLayoutManager"
implementation "com.google.maps.android:android-maps-utils:$mapUtilsVersion"
/*implementation "android.arch.lifecycle:extensions:$architectureVersion"
implementation "android.arch.lifecycle:runtime:$architectureVersion"*/
implementation 'androidx.room:room-runtime:2.1.0-beta01'
annotationProcessor 'androidx.room:room-compiler:2.1.0-beta01'
implementation "com.github.bumptech.glide:glide:$glideVersion"
annotationProcessor "com.github.bumptech.glide:compiler:$glideVersion"
implementation "com.evernote:android-job:$androidJobVersion"
implementation 'com.github.stfalcon:chatkit:0.3.3'
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
implementation 'com.devlomi.record-view:record-view:2.0.1'
implementation 'net.alexandroid.utils:exoplayerhelper:2.18'
implementation 'net.alhazmy13.MediaPicker:libary:2.4.4'
implementation 'com.stripe:stripe-android:6.1.2'
implementation 'com.applandeo:material-calendar-view:1.5.1'
implementation 'com.braintreepayments.api:drop-in:3.+'
implementation 'com.braintreepayments.api:braintree:2.+'
implementation 'com.facebook.android:facebook-login:[4,5)'
最佳答案
我遇到了同样的问题,alpha Material 库
似乎有些问题我将 build.gradle
中的 Material 库依赖项降级为 implementation 'com.google.android.material:material:1.0.0'
然后使缓存无效并从
重新启动工作室文件 -> 使缓存无效/重新启动...
它奏效了。
关于Android Studio XML 预览不显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56083927/
我经常使用 SSMS 查询数据和构建数据集,我的 IT 部门负责数据库管理。 最近我发现了 Azure Data Studio,我喜欢: 智能感知 源代码控制(例如使用 Git) 来自社区的扩展 SQ
我想根据我使用的 visual studio 版本编译不同的东西,比如 #if VISUAL_STUDIO_VERSION > 2015 eventH?.Invoke(this, EventArgs.
我们的开发团队计划从 visual studio 2005 升级到 visual studio 2010 -- 跳过 visual studio 2008。 大部分项目是VB ASP.NET项目,使用
我的Visual Studio 2015无法构建2010平台工具集。它说: The build tools for Visual Studio 2010 (v100) cannot be found.
我目前正在使用 Visual Studio 2015 来编程 ASP.NET Core 应用程序。我对安装 Visual Studio 2017 有以下疑问: 什么被认为是最佳实践和/或最干净的方法?
尝试从扩展和更新获取 Visual Studio 扩展时,出现以下错误:- 向 visualstudiogallery.msdn.microsoft.com/Services/VStudio/Exte
这个问题在这里已经有了答案: Can Visual Studio Code and VS 2012 be installed on same computer? (1 个回答) 关闭去年。 在安装了
作为标准安装的一部分,Visual Studio Code 带有一个名为“Monokai Dimmed”的颜色主题。 有没有办法将它移植到 Visual Studio 2015?我检查了社区主题( h
我想开始编程 CUDA。 我已经安装了 Visual Studio 2010 Express。 我还安装了 nVidia nSight Visual Studio。 而且我具备所有常见的先决条件(Ne
Visual Studio Community Edition是否可以使用Visual Studio Online帐户上的存储库? 我一直为包含在Online帐户中的Visual Studio Onl
我有一个我一直在开发的应用程序,但在 android studio 上遇到了问题。当我点击“build->run”然后选择我的设备时,应用程序永远不会在我的手机上运行(并且自动出现的android-s
我正在使用Visual Studio2010。我面临的一个问题是,当我创建一个新的Web项目时,Visual Studio将创建该项目,并且不会在解决方案资源管理器中显示其解决方案。 另一件事是,我想
我通读了这里的许多帖子,却找不到一个有效的明确答案。因此,在花了一些时间使它生效之后,我认为应该发布它。 问题:发布配置文件将建立在服务器上,但不会发布。 解: 确保已安装Microsoft Wind
我正在尝试使用Visual Studio 2012构建针对.NET 3.5的C++ CLI应用程序。 通过安装Visual Studio 2008,并指定v90平台工具集,我已经在一台机器上进行了这项
我在 Microsoft Visual Studios 2013 中有一个项目,我想在 Microsoft Visual Studios 2010 中打开它。有什么简单的方法吗?还是我必须在2010年
我想知道,如果我发送一个解决方案文件夹(它是用 visual studio C# 编写的),您可以在 visual studio for mac 中打开解决方案吗? 在visual studio 20
有没有办法在 Visual Studio Code 和 Visual Studio 中设置相同的快捷方式(而不必每次都手动更改它们)? 例如,我在 Visual Studio Code 中经常使用 A
我刚开始了解 Visual Studio Code。我想知道,我可以将 Visual Studio 替换为所有 .NET 开发相关的工作吗? 我可以节省 Visual Studio 许可的成本吗? V
我安装了具有有效许可证(Visual Studio 订阅)的 Visual Studio 2019 企业版(VS 2019 16.1.4),它运行良好。 突然之间,当我尝试打开项目或项目中的任何文件时
我一直在使用 Compass 编译 Windows 环境中的 sass 文件,无论是在命令行上还是使用 Compass-app 来查看目录。 我刚刚开始使用 Visual Studio(专业版 201
我是一名优秀的程序员,十分优秀!