ClassNotFoundException:找不到类“ com.example.blogapp.whateverString”

时间:2019-07-01 17:32:36

标签: android manifest androidx

我迁移androidx之后,当我单击按钮时它会显示给我 为什么会这样?

当我单击按钮打开日历时我想做什么

这是我单击按钮时遇到的错误

  java.lang.ClassNotFoundException: Didn't find class "com.example.blogapp.whateverString" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.example.blogapp-BjDX

这是我的Manifest.xml,whatString是从哪里来的

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.example.together">
    <!--
         The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
         Google Maps Android API v2, but you must specify either coarse or fine
         location permissions for the 'MyLocation' functionality.
    -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <!-- 맵 이용하기 위함 -->
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <!-- 다음 지도 -->
    <uses-permission android:name="android.permission.INTERNET" /> <!-- 대략적인 위치 참조 권한 -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <!-- 정확한 위치 참조 권한 -->
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

    <application
        tools:replace="android:appComponentFactory"
        android:appComponentFactory="whateverString"
        android:allowBackup="false"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true">

我使用这两行

tools:replace="android:appComponentFactory"
        android:appComponentFactory="whateverString"

因为我被添加了以下实现

    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'com.google.android.material:material:1.1.0-alpha07'
    implementation 'joda-time:joda-time:2.10.1'

从这里我看到有人在mycase中使用以下代码建议发生错误

tools:replace="android:appComponentFactory"
        android:appComponentFactory="whateverString"

所以这就是我使用“ WhateverString”的原因

我该如何解决这个问题? 我不明白为什么在迁移androidx后突然向我显示错误

0 个答案:

没有答案