Developed an unsigned APK,ran it through USB Debugging worked fine and ran the same transferring the APK file to an Android Phone(Oreo)it gets installed but doesn't open up(However many times i tap on the "Open" Button)
[Minimum SDK Version of APK is "Ice Cream Sandwich"]
Things I Tried:
adb shell pm uninstall com.example.seve
, Reinstalled still didn't opened.2019-10-10 19:52:07.241 28262-28262/? E/GlobalPackageInstaller: launchApp error:
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Intent.toString()' on a null object reference
at android.app.Instrumentation.execStartActivity(Instrumentation.java:1582)
at android.app.Activity.startActivityForResult(Activity.java:4555)
at android.app.Activity.startActivityForResult(Activity.java:4513)
at android.app.Activity.startActivity(Activity.java:4874)
at android.app.Activity.startActivity(Activity.java:4842)
at com.miui.global.packageinstaller.GlobalPackageInstallerActivity.g(Unknown Source:14)
at com.miui.global.packageinstaller.GlobalPackageInstallerActivity.onClick(Unknown Source:77)
at android.view.View.performClick(View.java:6304)
at android.view.View$PerformClick.run(View.java:24803)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Here are all my files.
MainActivity.java
ScreenItem.java
Any suggestion will be appreciated.
EDIT: I found that the error is hidden mainly in my application so, I tried View Breakpoints
and got something like this in logcat.Logcat tells that ClassNotFoundException
is caused by somewhere around line 19 MainActivity.java
but can't make much from it.
I tried disabling instant run got nothing and checked that <activity android:name=".IntroActivity">
is written instead of <activity android:name="android.app.IntroActivity
and enabled MultiDex"
2019-10-12 13:06:59.933 15201-15201/com.example.seve W/ResourceType: No package identifier when getting name for resource number 0x00000000
2019-10-12 13:07:00.100 15201-15201/com.example.seve D/AccessibilityManager: AccessibilityManager status: mPackageName = com.example.seve, mOptimizeEnabled = false, mIsEnabled = false, mIsUiAutomationEnabled = false, mIsInterestedPackage =false
2019-10-12 13:07:00.159 15201-15201/com.example.seve I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.example.seve.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:19)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7088)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7079)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1215)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2770)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.os.Looper.loop() (Looper.java:176)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6651)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:824)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64:Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.View$OnUnhandledKeyEventListener" on path: DexPathList[[zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/base.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_resources_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.seve-GCOyFEE-ADwenEs5Wnn_ZA==/split_lib_slice_6_apk.apk",
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at java.lang.Class dalvik.system.BaseDexClassLoader.findClass(java.lang.String) (BaseDexClassLoader.java:125)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String, boolean) (ClassLoader.java:379)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at java.lang.Class java.lang.ClassLoader.loadClass(java.lang.String) (ClassLoader.java:312)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.example.seve.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:19)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7088)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7079)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1215)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2770)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.os.Looper.loop() (Looper.java:176)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6651)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
2019-10-12 13:07:00.160 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:824)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: Rejecting re-init on previously-failed class java.lang.Class<androidx.core.view.ViewCompat$OnUnhandledKeyEventListenerWrapper>: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/view/View$OnUnhandledKeyEventListener;
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void androidx.core.view.ViewCompat.setOnApplyWindowInsetsListener(android.view.View, androidx.core.view.OnApplyWindowInsetsListener) (ViewCompat.java:2203)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at android.view.ViewGroup androidx.appcompat.app.AppCompatDelegateImpl.createSubDecor() (AppCompatDelegateImpl.java:637)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.ensureSubDecor() (AppCompatDelegateImpl.java:518)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatDelegateImpl.setContentView(int) (AppCompatDelegateImpl.java:466)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void androidx.appcompat.app.AppCompatActivity.setContentView(int) (AppCompatActivity.java:140)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void com.example.seve.MainActivity.onCreate(android.os.Bundle) (MainActivity.java:19)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle, android.os.PersistableBundle) (Activity.java:7088)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.Activity.performCreate(android.os.Bundle) (Activity.java:7079)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.Instrumentation.callActivityOnCreate(android.app.Activity, android.os.Bundle) (Instrumentation.java:1215)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at android.app.Activity android.app.ActivityThread.performLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent) (ActivityThread.java:2770)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.handleLaunchActivity(android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:2895)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.-wrap11(android.app.ActivityThread, android.app.ActivityThread$ActivityClientRecord, android.content.Intent, java.lang.String) (ActivityThread.java:-1)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread$H.handleMessage(android.os.Message) (ActivityThread.java:1616)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.os.Handler.dispatchMessage(android.os.Message) (Handler.java:106)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.os.Looper.loop() (Looper.java:176)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:6651)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:547)
2019-10-12 13:07:00.161 15201-15201/com.example.seve I/zygote64: at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:824)
You will need to generate a Signed apk:
https://www.jetbrains.com/help/idea/generating-a-signed-apk-through-an-artifact.html
To deploy and run an Android application on a physical device, you need to sign the application digitally. With IntelliJ IDEA, you can have your Android Application Package (.apk file) signed with an existing release key on package extraction. IntelliJ IDEA also incorporates a release key generation tool that can be invoked during the packaging procedure. Generated keys are saved in a keystore binary file.
You can have as many keystore files and keys as you need and use either existing keys, or create new ones in existing keystores, or even create new keystores.
Apart from using the Generate Signed APK Wizard, you can configure the .apk file as an artifact by creating an Android application artifact definition. When IntelliJ IDEA builds the package in accordance with this definition, the package is signed automatically.
User has mentioned in comments that he's using IntelliJ IDEA so this answer would be different depending on your IDE. Xamarin, for example, will generate the -Signed.apk whether or not you have it signed with a keystore, but that may vary by IDE.
As per the error:
Attempt to invoke virtual method 'java.lang.String android.content.Intent.toString()' on a null object reference
check your code again and debug. There is something wrong with your code.It does not seem to be an issue by installer.
User contributions licensed under CC BY-SA 3.0