๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ“ฑ| Android/โœ… | ์—๋Ÿฌํ•ด๊ฒฐ

java.lang.ClassNotFoundException: Didn't find class "com.example.community.MainActivity"

by immgga 2022. 4. 19.

์˜ค๋Š˜์˜ ์—๋Ÿฌ๋Š” ๋ฐ”๋กœ ํด๋ž˜์Šค๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์„ ๋•Œ ๋œจ๋Š” ๋ฒ„๊ทธ๋ฅผ ํ•ด๊ฒฐํ•˜๋Š” ๋ฐฉ๋ฒ•์„ ์•Œ์•„๋ณด๊ฒ ๋‹ค.

 

์—๋Ÿฌ ๋ฌธ๊ตฌ

 

java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.community/com.example.community.MainActivity}: java.lang.ClassNotFoundException: Didn't find class
"com.example.community.MainActivity" on path: DexPathList[[zip file "/data/app/~~Tv8GPXV34ciClaHYGt-_Gg==/com.example.community-9AL2Z2ybv12CTGrbGEP6mQ==/base.apk"],
nativeLibraryDirectories=[/data/app/~~Tv8GPXV34ciClaHYGt-_Gg==/com.example.community-9AL2Z2ybv12CTGrbGEP6mQ==/lib/x86, /system/lib, /system_ext/lib]]

 

๋‚˜์˜ ๊ฒฝ์šฐ์—๋Š” ์ด ์—๋Ÿฌ๋ฅผ ํ•ด๊ฒฐํ• ๋•Œ manifest์— ์‚ญ์ œ์‹œํ‚จ activity๋ฅผ ์ง€์šฐ์ง€ ์•Š์•„์„œ ๋ฐœ์ƒํ•œ ์—๋Ÿฌ์˜€๋‹ค

 

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.community">
    
    <application
    	... >
        
        // ์ง€์šด ๋ถ€๋ถ„
        <activity
            android:name=".MainActivity"
            android:exported="true">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        //
        
    </application>
</manifest>

์•ˆ์“ฐ๋Š” activity๋ฅผ ์ง€์›Œ์„œ ๊น”๋”ํžˆ ํ•ด๊ฒฐ๋˜์—ˆ๋‹ค.

728x90