Error while Building Project on Release

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Error while Building Project on Release

EaranMaleasi
Hi,
I have a Problem here which wouldn't let me build or deploy my project on Release. on Debug it works completely normal.
Here the StackTrace:
Error 113 The "GenerateJavaStubs" task failed unexpectedly.
System.ApplicationException: Failed to create JavaTypeInfo for class: Project.ViewPagerIndicator.TitlePageIndicator/SavedState ---> System.InvalidOperationException: You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute.
   at Xamarin.Android.Tasks.Generator.CreateJavaSources(List`1 javaTypes, String outputPath, Boolean useSharedRuntime, Boolean hasExportReference)
   --- End of inner exception stack trace ---
   at Xamarin.Android.Tasks.Generator.CreateJavaSources(List`1 javaTypes, String outputPath, Boolean useSharedRuntime, Boolean hasExportReference)
   at Xamarin.Android.Tasks.GenerateJavaStubs.Run()
   at Xamarin.Android.Tasks.GenerateJavaStubs.Execute()
   at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
   at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask, Boolean& taskResult) C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets

The Reference which seems to be missing, is referenced.
what is wrong here?
Reply | Threaded
Open this post in threaded view
|

Re: Error while Building Project on Release

EaranMaleasi
seems the Linking doesn't work here, setting it from Sdk and Userassemblies to Sdk Assemblies only solved it.
Reply | Threaded
Open this post in threaded view
|

Re: Error while Building Project on Release

Jonathan Pryor-2
In reply to this post by EaranMaleasi
On Jun 25, 2013, at 5:42 AM, EaranMaleasi <[hidden email]> wrote:
> I have a Problem here which wouldn't let me build or deploy my project on Release. on Debug it works completely normal.

Here's the important part of the stack trace:

> You need to add a reference to Mono.Android.Export.dll when you use ExportAttribute or ExportFieldAttribute.

We'll be making this error more visible and useful in a future release.

> The Reference which seems to be missing, is referenced.

Mono.Android.Export.dll is referenced in your project? If that's the case, something else is wrong, and I would love to see your project so I can track this down.

Thanks,
 - Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid
Reply | Threaded
Open this post in threaded view
|

Re: Error while Building Project on Release

catalina.chioveanu
Hi

I have the same problem. I am referencing Mono.Android.Export.dll and it still doesn't work.

It works if I set Sdk Assemblies only but not if is set it to Sdk and User Assemblies.

While it would't be a problem to use Sdk Assemblies only this causes the app to crash if the user clears the app cache from the phone's settings. I know this is not likely to happen often but it's not really the expected behaviour of an app.

Reply | Threaded
Open this post in threaded view
|

Re: Error while Building Project on Release

Jonathan Pryor-2
On Jan 10, 2014, at 11:20 AM, catalina.chioveanu <[hidden email]> wrote:
> It works if I set Sdk Assemblies only but not if is set it to Sdk and User Assemblies.

Linking both SDK and User assemblies is generally a good way to break things, as your assemblies won't be annotated with [Preserve] to ensure that everything actually needed is kept by the linker.

Don't use it unless you really need to.

> While it would't be a problem to use Sdk Assemblies only this causes the app to crash if the user clears the app cache from the phone's settings.

This doesn't make sense; is this a Debug build or a Release build?

Debug builds with Fast Deployment work by placing the assemblies into the app's `files` directory. Consequently, if the you clear the App's cache & data from the Settings app, you will also nuke the assemblies.

This is (more or less) By Design, and should only impact Developers; Debug builds are NOT intended for use in App stores or for end users.

Release builds embed the assemblies into the .apk, and they are never located into the `files` directory. Consequently, clearing the App's cache & data will have no impact on Release builds.

- Jon

_______________________________________________
Monodroid mailing list
[hidden email]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid