BabulaNo
BabulaNo

Reputation: 23

Problems with running Xamarin for Visual Studio 2017

Okay, I've been searching and searching and it seems that people have somewhat similar scenarios concerning my problem, however, none of the solutions presented even offer a sound solution. I've recently installed Visual Studio 2017. I went on to test the Xamarin Android Emulator by creating an app (named "Try") with absolutely nothing on it. Mind you, this is a fresh install of Visual Studio 2017 with JDK 1.8.0_152 and Android 7.1.1 (25). Right off the bat, the build failed. I cleaned the solution and tried to build again. Fail.

I kept getting these errors:

    Severity    Code    Description Project File    Line    Suppression State
Error       error: <identifier> expected
package try.try;    Try C:\Users\User\source\repos\Try\Try\obj\Debug\android\src\try\try\R.java 8   
_______________________________________________________________________

Severity    Code    Description Project File    Line    Suppression State
Error       error: class, interface, or enum expected
package try.try;    Try C:\Users\User\source\repos\Try\Try\obj\Debug\android\src\try\try\R.java 8   
_______________________________________________________________________

Severity    Code    Description Project File    Line    Suppression State
Error       error: class, interface, or enum expected
package try.try;    Try C:\Users\User\source\repos\Try\Try\obj\Debug\android\src\try\try\R.java 8   

Great, so this has to have something to do with R.java 8? I go to the source and get this:

  /* AUTO-GENERATED FILE.  DO NOT MODIFY.
 *
 * This class was automatically generated by the
 * aapt tool from the resource data it found.  It
 * should not be modified by hand.
 */

package try.try;

public final class R {
    public static final class attr {
    }
    public static final class id {
        public static final int textureView1=0x7f040000;
    }
    public static final class layout {
        public static final int main=0x7f020000;
    }
    public static final class string {
        public static final int app_name=0x7f030000;
    }
}

What is wrong here? I haven't even began to start coding or tinkering with Xamarin yet. Can someone please explain?

Upvotes: 2

Views: 647

Answers (1)

Farai Chakarisa
Farai Chakarisa

Reputation: 26

Figured it out. I don't know why, but Visual Studio 2017 put those project files in a completely different location unlike previous versions. Usually, it would have been put here: Documents>Visual Studio 2017>Projects>[Project Name]. It seems that the place you put your project is conflicting with Xamarin somehow. My suggestion would be to change the project location to what I mentioned above and then build the solution again. If that doesn't work, make a new project with the specified location and test it out. I had a similar problem and that fixed it for me.

Upvotes: 1

Related Questions