mono / CocosSharp

CocosSharp is a C# implementation of the Cocos2D and Cocos3D APIs that runs on any platform where MonoGame runs.
492 stars 159 forks source link

Xamarin.Forms project build error with CocosSharp.Forms library #408

Open elvisxia opened 7 years ago

elvisxia commented 7 years ago

By adding CocosSharp.Forms nuget package to PCL Project and Droid project I got following error:

'Resource.String' does not contain a definition for `ApplicationName' 
'Resource.String' does not contain a definition for `Hello'

I workaround this by deleting the following two lines of codes in Resource.Designer.cs:

    global::CocosSharp.Forms.Android.Resource.String.ApplicationName = global::CocosSharpDemo.Droid.Resource.String.ApplicationName;
    global::CocosSharp.Forms.Android.Resource.String.Hello = global::CocosSharpDemo.Droid.Resource.String.Hello;

But why are these codes added automatically, are these codes necessary?

haryck commented 7 years ago

just add to your project file strings.xml contains :

<?xml version="1.0" encoding="utf-8"?>

applicationName Hello

On Tue, Jan 17, 2017 at 10:02 AM, Xuchen.Xia notifications@github.com wrote:

By adding CocosSharp.Forms nuget package to PCL Project and Droid project I got following error:

'Resource.String' does not contain a definition for ApplicationName' 'Resource.String' does not contain a definition forHello'

I workaround this by deleting the following two lines of codes in Resource.Designer.cs:

global::CocosSharp.Forms.Android.Resource.String.ApplicationName = global::CocosSharpDemo.Droid.Resource.String.ApplicationName;
global::CocosSharp.Forms.Android.Resource.String.Hello = global::CocosSharpDemo.Droid.Resource.String.Hello;

But why are these codes added automatically, are these codes necessary?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mono/CocosSharp/issues/408, or mute the thread https://github.com/notifications/unsubscribe-auth/AMW4MlqrI_TWfBHk4mR8DXZ23eR9LGriks5rTC82gaJpZM4LlLg- .

EdwardCaulfield commented 7 years ago

I am getting the same issue:

Warning XA0106: Skipping MusicTrainer2.Droid.Resource.String.ApplicationName. Please check that your Nuget Package versions are compatible Warning XA0106: Skipping MusicTrainer2.Droid.Resource.String.Hello. Please check that your Nuget Package versions are compatible.

My Resource.Designer.cs file does not reference either one of these strings. I have cleaned and rebuilt. I have added the XAML text as suggested above (quoted text below only so it shows up in this forum's tool):

<resources> <string name="ApplicationName">applicationName</string> <string name="Hello">Hello</string> </resources>

With no improvement. Any idea what I can try next?

Many thanks

Edward