Android Activity 실행시 AndroidManifest에 Activity 선언되어 있는데도 아래와 같은 에러가 발생함.
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.json.example/com.json.ui.settings.Engineer}: java.lang.IllegalAccessException: java.lang.Class<com.json.mcptt.ui.settings.Engineer> is not accessible from java.lang.Class<android.app.AppComponentFactory>
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2882)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3087)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1817)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6746)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Caused by: java.lang.IllegalAccessException: java.lang.Class<com.json.ui.settings.Engineer> is not accessible from java.lang.Class<android.app.AppComponentFactory>
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at android.support.v4.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:43)
at android.app.Instrumentation.newActivity(Instrumentation.java:1216)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2870)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3087)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1817)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6746)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
해결 방법
class Engineer extends AppCompatActivity -> public class Engineer extends AppCompatActivity
실행 Activity Class를 public으로 선언
class Engineer extends AppCompatActivity
public class Engineer extends AppCompatActivity
반응형
'Android > Exception' 카테고리의 다른 글
[Android] ConcurrentModificationException hashmap 해결 방법 (0) | 2021.04.08 |
---|---|
[안드로이드] Firebase java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/internal/firebase-perf/M; (36) | 2020.09.22 |
[안드로이드] java.net.UnknownHostException 에러 (0) | 2020.06.09 |
안드로이드 ClassCastException 에러 (0) | 2020.06.04 |