Unable to instantiate activity

IDE: _Visual Studio 2013
Version: 8.4.96.2037
Target (If relevant): Android
Description:
A minimum Android application that was created with earlier versions of Elements, with the latest version does not work, produces the following error:

I attached project, video and screenshot.
Bug257.rar (4.3 MB)

Best regards,
Jose A.

Works fine here. I did have to delete the .vs/.suo files for some reason, they were caching your local directories.

No, we have not deleted any .vs/.suo file. The last time that happened to us this, trying to recreate the error that I have sent to you in another message, after giving that error, I created a new project, after, without doing anything else, what happened is exactly what that you see in the video.

yeah it makes no sense. Do you get any other exceptions/errors in the log?

Sorry, the last part of the message:

The last time that happened to us this, trying to recreate the error
that I have sent to you in another message, after giving that error, I
created a new project, after, without doing anything else, what happened
is exactly what that you see in the video.
I wanted to say about the other error:
Object reference not set to an instance of an object - #2 by ck

but, no, we have not deleted any .vs/.suo file.

the .vs/.suo thing was a local issue. The real problem is that I can’t see this problem here :frowning:

Run in Tablet Nexus 7 with Android 6.0.1

I attached a new video and 2 log files of 2 different runs of the same sample.
Bug257-2.part1.rar (5 MB)
Bug257-2.part2.rar (5.0 MB)

I usually use the Visual studio Android Emulators, does it show there too for you?

We have tried the same project I’ve sent you on another of our computers and it still works worse.
I attached a video and the log of those tests.
Bug257-3.rar (738.3 KB)

We are using Visual Studio 2013 that does not have Android emulator.

I installed a version of Visual Studio 2015 (Visual Studio Enterprise Update 2), if I create a Xamarin application, this application lets I select VS Android emulator and run without problems, however, in a Elements application I can not select the VS Android emulator.
What I can do to display the VS emulator in the selection list?

Best regards,
Jose A.

Tools/vidual studio Android emulators

Start one you like and it will work from oxygene.

I did what you say, in screenshots that have made you, I had an open emulator, however, it is not shown in the selection list. :cold_sweat:

Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools in the folder tree on the left.Modify the Path registry variable to match the path to Android SDK configured for Elements (or vice versa)

Carlo,
With the indications you have given me now the VS 2015 emulator appears in the selection list. :grinning: Thanks.

If I create an Android application everything works correctly and is displayed in the emulator, however, the application I sent you does not work either in VS2015 or VS2013. It is very strange that the application works for you.
I attached several new logs of Visual Studio 2015, a video, and the project that I sent you with some variations.
Bug257-3.part1.rar (5 MB)
Bug257-3.part2.rar (5 MB)
Bug257-3.part3.rar (1.7 MB)

Have you seen the other logs that I sent you? Do you get any clue of the problem?

Carlo,
Here are happening very strange things.
I attached 2 projects, which apparently are equal, the only difference is GUID’s and path projects.
Bug257-4.rar (2.2 MB)

Both compared with Beyond Compare, source code, project code are identical.
However, they generate a very different .suo and classes.dex file very different in size.
The project does not work and causes the error I told you, has the .suo and classes.dex files much larger.
Why these files are much larger than the project that is working?


If I clean the project not ok and I do rebuild in obj/Debug/Android is generated AndroidManifest.xml file, but this file has a very different line to the project that is working properly.
Why is this happening?

I hope that with all this information you can correct the problem that is happening,
although you can not reproduce it on your computer.

Best regards,
Jose A.

Looking at the diff, the left one is compiled in debug mode, the right one in release. (which should account for the size difference and missing .di file).

the manifest inside obj/ should always be updated (have the updated version info) from within the project file.

I can’t explain the suo files, but those are VS created and pretty much hold state.

so I do rebuild of both projects (rebuild, not build!):

Solution\SendaObjects.BaseLib.Test\SendaObjects.BaseLib.Android.Test
and
SendaObjects.BaseLib.Test\SendaObjects.BaseLib.Android.Test

Both deploy and run fine to the emulator (which iirc you use now too right?)

they’re both equal in side: 233kb for the apk 302 for the jar.

My colleague tried the same and had the same result.

Looking at the diff, the left one is compiled in debug mode, the right one in release. (which should account for the size difference and missing .di file).

Have you not seen the projects? Both are compiled in debug mode.
In both panels is displayed the .di file, why do you say that is not the .di file.?
So the differences in size of the files I’ve indicated are very significant.

the manifest inside obj/ should always be updated (have the updated version info) from within the project file.

If you look at both projects that have sent you, the manifests are identical.

so I do rebuild of both projects (rebuild, not build!):

I do rebuild, not build.

Solution\SendaObjects.BaseLib.Test\SendaObjects.BaseLib.Android.Test
and
SendaObjects.BaseLib.Test\SendaObjects.BaseLib.Android.Test

Both deploy and run fine to the emulator (which iirc you use now too right?)

they’re both equal in side: 233kb for the apk 302 for the jar.

As I mentioned, in my VS emulator the problem also occurs.

I have done more research and conclusions you can see in the video attached. The culprit is the sugar.jar file of the latest version of Elements.

The steps to reproduce the problem on my computer are:
(These are the steps that I do in the attached video)

  1. I create a new application.
  2. I do build. The application runs correctly on my Nexus 7.
  3. I do rebuild and run. The application runs correctly on my Nexus 7.
  4. I add a reference to sugar.jar and run. The application runs correctly on my Nexus 7.
  5. I do rebuild and run. The application runs and displays the error.

That is, the error only occurs after adding sugar.jar and to rebuild.

Bug257-5.part1.rar (5 MB)
Bug257-5.part2.rar (4.8 MB)

Note (update): We have performed the steps I indicated in another of our computers and the problem is perfectly reproduced, so obviously it is not a problem of my computer. It may be that you may have a different sugar.jar. You must do the tests with an installation of the latest version of Elements last week.

Note (update2): We have further investigated and have downloaded from github the master and develop versions. We have compiled both. If we reference in the project the version Develop the problem is reproduced. However, if the project reference the master version then the error is not shown and everything works properly. So it seems that in the latest version of Elements you are included the sugar.jar file based on the Develop version.

Aaaah! That could explain things.my sugar is slightly newer.ill try last week’s and tomorrow’s build tomorrow when I’m back in the office and confirm.

Ok. Best regards.

Just wanted to confirm:

Last fridays build sugar was broken. When I build a project and run it it says “dexopt failed” and stops running.
Todays build works fine (Also confirmed)

Sorry for the inconvenience.