kotlin自定义View出现 java.lang.ClassNotFoundException

本文介绍了在Android开发过程中遇到的自定义View引用错误及ClassNotFound异常的原因与解决办法,涉及build.gradle配置、Kotlin插件应用及依赖库添加等关键步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

问题1:找不到所引用的自定义View

Didn’t find class “dxf.example.dxf.customviewdemo.MyTextView” on path: DexPathList

原因:build.gradle中 应用插件

解决:添加 apply plugin: ‘kotlin-android’

问题2: java.lang.ClassNotFoundException: Didn’t find class “kotlin.jvm.internal.Intrinsics”

原因: build.gradle中未添加kotlin标准库依赖(使用tools 应用kotlin可能未成功添加)

解决: dependencies中增加 compile “org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version”

07-01 11:39:12.926 2846 2846 W Looper : Slow dispatch took 124ms main h=com.android.server.notification.NotificationManagerService$WorkerHandler c=com.android.server.notification.NotificationManagerService$$ExternalSyntheticLambda0@8145441 m=0 07-01 11:39:12.928 6568 6568 D OMG_Observer: mScreenWidthDisplay = 1080, mScreenHeightDisplay = 2400, mRotation = 0, mOrient = 1 , mMiniSizeLimit = 660, mNormalSizeLimit =1800 07-01 11:39:12.933 1288 1865 D VRR [OTI]: handleContentIdleCheck [0.000000] 07-01 11:39:12.951 5245 5245 D BaseDepthController: setSurface: 07-01 11:39:12.951 5245 5245 D BaseDepthController: mWaitingOnSurfaceValidity: false 07-01 11:39:12.951 5245 5245 D BaseDepthController: mSurface: null 07-01 11:39:12.952 5245 5245 D LAUNCHER3: Launcher, handlePendingRequest: mPendingActivityRequestCode = -1, handled = false 07-01 11:39:12.954 5245 5245 D StateManager: goToState - fromState: Normal, toState: Normal, partial trace: 07-01 11:39:12.954 5245 5245 D StateManager: at com.android.launcher3.statemanager.StateManager.moveToRestState(StateManager.java:500) 07-01 11:39:12.954 5245 5245 D StateManager: at com.android.launcher3.statemanager.StateManager.moveToRestState(StateManager.java:491) 07-01 11:39:12.954 5245 5245 D StateManager: at com.android.launcher3.statemanager.StatefulActivity.onStop(StatefulActivity.java:119) 07-01 11:39:12.955 5245 5245 D StatsLog: LAUNCHER_ONSTOP 07-01 11:39:12.958 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.oplus.inner.view.ViewWrapper 07-01 11:39:12.958 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.color.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.oplus.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.color.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.oplus.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.color.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.oplus.inner.view.ViewWrapper 07-01 11:39:12.959 5245 5245 D ViewNative: java.lang.ClassNotFoundException: com.color.inner.view.ViewWrapper 07-01 11:39:12.976 6306 6329 I droid.apps.maps: Waiting for a blocking GC ProfileSaver
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值