Android: Class Not Found runtime exception - release build only - android

We have an app that has had several version on Google Play and has been working fine. The latest updated causes a runtime error "Class not found" for our main activity. The activity is called 'Home'.
The runtime error does NOT occur on a debug build, only as release build.
The activity has not changed for several updates, but suddenly has started raising these runtime errors on start-up.
Cheers,
Peter

Try do a clean on your project and export of ECLIPSE
This way: project > android tools > export as signed application package.

Related

React-native release apk refuses to install

I have encounter a problem I am unable to solve, I have followed all steps from:
Unable to install signed apk from React Native but the ones in Android Studio since I am not using it and the steps needed to sign the apk from https://facebook.github.io/react-native/docs/signed-apk-android, I still get the error:
There was a problem parsing the package
In logcat I get the error:
05-23 09:44:23.964 3613 3613 W PackageInstaller: Parse error when parsing manifest. Discontinuing installation
This error make me thing the error cannot be with signature but there is no manifest file, I searched for it and debug build works.
It only happens with release builds. I hope some of you can help me since I am lost.
I have recreated the project and repeated the steps, that solved the problem.

Signing The App Bundle Base Module And Dynamic Feature Module

In the Google official guide for App Bundle: https://developer.android.com/guide/app-bundle/configure#base_build_config it said that signing information only needs to be specified in the base module build.config file. The dynamic module signing info goes with base module.
I am using my own keystore file, so I only include the signingConfig in the base module. However, when I build and run the app on a device, it always pop up the error:
Installation failed with message Failed to finalize session :
INSTALL_FAILED_INVALID_APK:
/data/app/vmdl538875391.tmp/1_feature_-debug signatures are
inconsistent. It is possible that this issue is resolved by
uninstalling an existing version of the apk if it is present, and then
re-installing.
When I include the signing info in the dynamic module, the error goes away.
So does this conflict with the official guide? Or did I do anything incorrect here?
The problem is caused by a setting in Edit Configuration.. In order to only include signing info in the base module of a bundle, I need to choose 'APK from app bundle', not the 'default APK'. Otherwise, Android Studio will use the signing info to sign the APK instead of the bundle.
Do it like this
menu "Build"
run "Rebuild Project".
Then run app on device or emulator
or if the above solution doesn't work.
Then try this
Disable the Instant run in Android Studio and then Clean, Rebuild and Run, It should fix this issue.

Gradle build error after updating Android Studio to 2.2 Preview 3

After updating AS from 2.2 Preview 2 to 2.2 Preview 3, and updating an AS project to the new format, the follow error is encountered when trying to build & run the app:
Error:A problem was found with the configuration of task
':app:generateDebugInstantRunAppInfo'.
File '\app\build\intermediates\bundles\debug\instant-run\AndroidManifest.xml'
specified for property 'mergedManifest' does not exist.
However the above message just points to failure in the prior build processes, where google-services.json isn't properly imported, and the following AndroidManifest entry would produce symbol 'google_play_services_version' not found error after the update:
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
Additionally all the activity entries and most service entries in AndroidManifest have this error: 'xxxService' is not assignable to 'android.app.Activity/Service'
Clean Project & Build Project doesn't help, any ideas on how to fix this?
Disable Instant Run.
Build and launch app.
Stop app.
Enable Instant Run.
Build and launch app.
I noticed the same error after I took the preview 3 update. The above steps corrected the issue for me.
To fix the same issue with Preview 4,
Enable Instant Run from settings.
Delete the App from device/simulator.
Clean Project.
Rebuild and launch App.

Error in Eclipse when trying to export apk

I'm trying to export my game apk for publishing to the store, but then I get an error saying 'compilation issues', how do i fix this? I've tried everything, it still doesnt get fixed, and when i go to my project theres a red x over my project, i'm guessing this might be the error, please refer to the screenshot
http://postimg.org/image/osiir584t/
Follow the Steps :
1.Remove Automatic build selection
2.Clean your project
3.Build the project
4.Export the apk
First fix your project's error then you can export it.
Fix your project code(Make sure that don't present any error) that gives compilation error.
Clean your project
Then export for publish your app..
Well, unsurprisingly this means the compiler runs into problems when compiling the release apk. These errors should appear in either the 'Problems' view or one of the consoles (you may need to switch between them). Finding those will help track the actual problem down.
Also, since you mentioned changing package names you may want to check my answer here: Serializing CDT Project settings has encountered a. I'm fairly certain that changing the package name for my project was what caused Eclipse to corrupt my project configuration back then.

Error When Update Eclipse with Grandle

My Eclipse :
Version: Indigo Service Release 2
Build id: 20120216-1857
(Installed with Android ADT)
JDK 7
JRE 7
i recently learn Libgdx become grandle project, so it says to import project created by libgdx jar into Eclipse using Import->Grandle->....
But i cannot find it in "import".
After searching, it must added additionally plugin into eclipse
I try to update my Eclipse with Grandle by "install new software" and add url such as :
http://dist.springsource.com/snapshot/TOOLS/gradle/nightly (latest development snapshot)
http://dist.springsource.com/milestone/TOOLS/gradle (latest milestone build)
http://dist.springsource.com/release/TOOLS/gradle (latest release)
But it said error like :
An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.core,3.6.2.201410090835-RELEASE.
Error reading signed content:C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile6188792910440798483.jar
An error occurred while processing the signatures for the file: C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile6188792910440798483.jar
Problems downloading artifact: org.eclipse.update.feature,org.springsource.ide.eclipse.gradle.feature,3.6.2.201410090835-RELEASE.
Error reading signed content:C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile9055408208958627131.jar
An error occurred while processing the signatures for the file: C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile9055408208958627131.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.toolingapi,3.6.2.201410090835-RELEASE.
Error reading signed content:C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile158162502031506472.jar
An error occurred while processing the signatures for the file: C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile158162502031506472.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.ui,3.6.2.201410090835-RELEASE.
Error reading signed content:C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile8390443836635093074.jar
An error occurred while processing the signatures for the file: C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile8390443836635093074.jar
Problems downloading artifact: osgi.bundle,org.springsource.ide.eclipse.gradle.ui.taskview,3.6.2.201410090835-RELEASE.
Error reading signed content:C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile4151621413709401624.jar
An error occurred while processing the signatures for the file: C:\Users\LUTHFA~1\AppData\Local\Temp\signatureFile4151621413709401624.jar
I search more link and get :
https://www.eclipse.org/forums/index.php/t/243191/
that says i must add following lane to my eclipse.ini
-Djava.util.Arrays.useLegacyMergeSort=true
but looks like no result at all..
i also follow this :
https://github.com/spring-projects/eclipse-integration-gradle/
but cannot and still displayed error above.
another link :
http://estiloasertivo.blogspot.com/2013/03/tutorial-howto-install-and-configure.html
still not work.
i dont know what should i do anymore.
please help me or point me to fix those problems..
Thank you
Sorry if little messy in my explanation.
You should be able to open a command line from your main project and do a 'gradlew eclipse'. Once that runs, you should be able to import it in Eclipse as a normal existing project since Gradle will have generated the Eclipse-related project files that are needed for Eclipse to recognize and build a project.
Don't update Eclipse to grandle, Grandle is an separate compilation kit an this feature is added in Android Studio. So, better download Android Studio instead of updating eclipse
Eclipse recommended (4.4) 3.6.2.RELEASE for gradle plugin. Check this. you just need to drag install button from here to your eclipse and it will start downloading and installing.

Categories

Resources