简体   繁体   中英

Unable to open signed APK from android studio

I am able to run an android app no problem, when I just hit the 'Run' button in android studio. However, when I generate a signed APK from android studio I am unable to run the app from the signed APK. I am able to install it but not run it.

I even put the app onto Google Play for an alpha test and the same error occurs. I am able to download it, but not run it.

My build variant is release mode.

Any thoughts as to why I can't open the app?

应用安装

This means that you are probably using proguard , causing problem during the runtime.

You can check if you are using it if you have this line on your gradle file: minifyEnabled true

If so, then open your file called proguard-rules.pro and try to edit the properties of your app, because probably proguard is shrinking or removing useful classes, causing your app to crash at launch as the device failed to find the necessary class or the good ones.

If you are not using proguard, plug the phone on your IDE and check the logcat: you will be able to see why your app is crashing at launch. This problem can come from a bad class cast, from the multiDexEnabled parameter, etc... in which case we need to know more.

Add your AndroidManifest.xml

<activity android:name=".YourActivityName">
    <intent-filter>
         <action android:name="android.intent.action.MAIN"/>
         <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
</activity>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM