Bug 47086 - Unable to instantiate application object on android 4.4 devices.
Summary: Unable to instantiate application object on android 4.4 devices.
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2016-11-16 08:41 UTC by Dat Tran
Modified: 2017-09-06 17:32 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
The log file from Google Play Store. (460.40 KB, text/plain)
2016-11-16 08:41 UTC, Dat Tran
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Dat Tran 2016-11-16 08:41:34 UTC
Created attachment 18481 [details]
The log file from Google Play Store.

After upgraded the Xamarin to the latest version(mono android 7.0.2.37), My apps fail to start with the following information (on android 4.4 devices): 

FATAL EXCEPTION: main
 Process: homee.consumer.droid, PID: 14134
 java.lang.RuntimeException: Unable to instantiate application md55d5cb406ba4c1531f35bd0b5bdf1c3a7.HomeeApplication: java.lang.ClassNotFoundException: Didn't find class "md55d5cb406ba4c1531f35bd0b5bdf1c3a7.HomeeApplication" on path: DexPathList[[zip file "/data/app/homee.consumer.droid-1.apk"],nativeLibraryDirectories=[/data/app-lib/homee.consumer.droid-1, /vendor/lib, /system/lib]]
 	at android.app.LoadedApk.makeApplication(LoadedApk.java:516)
 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4398)
 	at android.app.ActivityThread.access$1500(ActivityThread.java:139)
 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1270)
 	at android.os.Handler.dispatchMessage(Handler.java:102)
 	at android.os.Looper.loop(Looper.java:136)
 	at android.app.ActivityThread.main(ActivityThread.java:5102)
 	at java.lang.reflect.Method.invokeNative(Native Method)
 	at java.lang.reflect.Method.invoke(Method.java:515)
 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
 	at dalvik.system.NativeStart.main(Native Method)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "md55d5cb406ba4c1531f35bd0b5bdf1c3a7.HomeeApplication" on path: DexPathList[[zip file "/data/app/homee.consumer.droid-1.apk"],nativeLibraryDirectories=[/data/app-lib/homee.consumer.droid-1, /vendor/lib, /system/lib]]
 	at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
 	at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
 	at android.app.Instrumentation.newApplication(Instrumentation.java:998)
 	at android.app.LoadedApk.makeApplication(LoadedApk.java:511)
 	... 11 more
Comment 2 Niels 2017-07-06 06:51:11 UTC
Yesterday I got this error again in our project. I was using the Beta channel and this error occurred on two of my testdevices: Android 4.4.2 and Android 4.1.2. It did not crash on my Galaxy S7 with Android 7.0

The error went away after I switched back to Stable channel.

Beta channel:

Visual Studio Enterprise 2017 for Mac (Preview)
Version 7.1 Preview (7.1 build 1258)
Installation UUID: 4483d0e1-4909-4f5e-bc97-f9d6f3d4bf06
Runtime:
	Mono 5.2.0.196 (2017-04/478c04a) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000196

NuGet
Version: 4.3.0.2418

.NET Core
Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Version: 7.4.0.13 (Visual Studio Enterprise)
Android SDK: /Users/nielscup/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.2

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b

Xamarin.iOS
Version: 10.12.0.12 (Visual Studio Enterprise)
Hash: 494fcbcf
Branch: d15-3
Build date: 2017-06-23 12:25:55-0400

Xamarin.Mac
Version: 3.6.0.11 (Visual Studio Enterprise)

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Build Information
Release ID: 701001258
Git revision: b0333c272ef55159b4c209e71698203d2fb4acdd
Build date: 2017-06-26 17:47:47-04
Xamarin addins: 31cc58bd6e356d0e68b4dd5c9b51283f1506ce99
Build lane: monodevelop-lion-d15-3

Operating System
Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 3 jzeferino 2017-08-21 18:00:35 UTC
After the last Xamarin STABLE RELEASE: 15.3I've got this same issue in devices running 4.4x not on 5.x and above.

Here my configuration:

Visual Studio Enterprise 2017 for Mac
Version 7.1 (build 1297)
Installation UUID: 4126a675-f1d9-404c-a489-ee603e8ba19b
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

NuGet
Version: 4.3.0.2418

.NET Core
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
	1.1.1
	1.0.4
SDK: /usr/local/share/dotnet/sdk/1.0.3/Sdks
SDK Version: 1.0.3
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks

Xamarin.Profiler
Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Xamarin.Android
Version: 7.4.0.19 (Visual Studio Enterprise)
Android SDK: /Users/jzeferino/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.2   (API level 17)
		4.4   (API level 19)
		5.1   (API level 22)
		6.0   (API level 23)
		7.0   (API level 24)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Xamarin Inspector
Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b

Xamarin.Mac
Version: 3.6.0.17 (Visual Studio Enterprise)

Xamarin.iOS
Version: 10.12.0.18 (Visual Studio Enterprise)
Hash: 4a279c9a
Branch: d15-3
Build date: 2017-08-02 12:38:11-0400

Build Information
Release ID: 701001297
Git revision: 9c5299666538b2f8baf501418a5c064d784d64da
Build date: 2017-08-07 11:29:35-04
Xamarin addins: 3bb0c32a14f1b7e368bf5ac53a84c3581c019391
Build lane: monodevelop-lion-d15-3

Operating System
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
    Thu Jun 15 17:36:27 PDT 2017
    root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64
Comment 4 jzeferino 2017-08-22 08:40:49 UTC
As a workaround I added multidex.keep and added my Custom application there.
Comment 5 gcnew 2017-08-22 10:00:58 UTC
OK, after two days of hell Solution to hapless people like me:
Do not use Android SDK build tools 25.0.3. 
It fails like it's mentioned in the latest post.
Install 26.0.1
Comment 6 gcnew 2017-08-22 11:03:44 UTC
I was too quick, still no success.
@jzeferino what do you have in your multidex.keep?
Comment 7 jzeferino 2017-08-22 13:10:04 UTC
I've posted that in Bug #51480
Comment 8 Ireshika 2017-08-29 08:27:56 UTC
Facing the same issue with following configurartion


=== Xamarin Studio Community ===

Version 6.3 (build 864)
Installation UUID: f18c5f2a-8d6c-4438-bad5-2566d475acf2
Runtime:
	Mono 5.2.0.215 (d15-3/da80840) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 502000215

=== NuGet ===

Version: 3.5.0.0

=== Xamarin.Profiler ===

Version: 1.5.5
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin Inspector ===

Version: 1.2.2
Hash: b71b035
Branch: d15-1
Build date: Fri, 21 Apr 2017 17:57:12 GMT

=== Apple Developer Tools ===

Xcode 8.3.3 (12175.1)
Build 8E3004b

=== Xamarin.Mac ===

Version: 3.6.0.19 (Xamarin Studio Community)

=== Xamarin.Android ===

Version: 7.4.0.21 (Xamarin Studio Community)
Android SDK: /Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.1    (API level 16)
		4.2    (API level 17)
		4.3    (API level 18)
		4.4    (API level 19)
		4.4.87 (API level 20)
		5.0    (API level 21)
		5.1    (API level 22)
		6.0    (API level 23)
		7.0    (API level 24)
		7.1    (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 26
SDK Build Tools Version: 25.0.3

Java SDK: /usr
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin.iOS ===

Version: 10.12.0.20 (Xamarin Studio Community)
Hash: 80b8487d
Branch: d15-3
Build date: 2017-08-18 16:07:26-0400

=== Build Information ===

Release ID: 603000864
Git revision: 6c2f6737278ccc3e81e12276d49c0d92f975f189
Build date: 2017-04-24 11:26:01-04
Xamarin addins: d8d46e577d8507c35260ce9d73df3c33415bb214
Build lane: monodevelop-lion-d15-1

=== Operating System ===

Mac OS X 10.12.4
Darwin 16.5.0 Darwin Kernel Version 16.5.0
    Fri Mar  3 16:52:33 PST 2017
    root:xnu-3789.51.2~3/RELEASE_X86_64 x86_64
Comment 9 Brendan Zagaeski (Xamarin Team, assistant) 2017-09-06 17:32:29 UTC
## Redirection of Comment 2 - Comment 8

For occurrences of error messages similar to Comment 0 on Xamarin.Android version 7.4 with multidex enabled, please see Bug 59036.