2016-11-25 6 views
-1

テスト用の電話(Samsung Galaxy S4 Mini)でアプリケーションを実行する場合、Visual Studioで次のエラーが表示されます:1> C:\ Program Files(x86)\ MSBuild \ Xamarin \ Android \ Xamarin.Android.Common.targets(2066,3):エラー:java.lang.UnsupportedClassVersionError:com/android/dx/command/Main:サポートされていないmajor.minorバージョン52.0 ' これを解決するには?サポートされていないmajor.minorバージョン52.0 Visual Studio

答えて

0

TL; DR:不適切なJDKバージョンを使用しています。


全答:

The issue is because of Java version mismatch.

Referring to the Wikipedia Java Class Reference :

J2SE 8 = 52

J2SE 7 = 51

J2SE 6.0 = 50

J2SE 5.0 = 49

JDK 1.4 = 48

JDK 1.3 = 47

JDK 1.2 = 46

JDK 1.1 = 45

These are the reported major numbers. The error regarding the unsupported major.minor version is because during compile time you are using a higher JDK and a lower JDK during runtime.

Thus, the 'major.minor version 52.0' error is possibly because the jar is compiled in jdk 1.8, but you are trying to run it in jdk 1.7 environment. To solve this, it's always better to have the jdk and jre pointed to the same version.


参照

+1

これを解決するにはどうすればよいですか? 1.7 JDKをダウンロードしますか?申し訳ありませんが、すべての質問については、私はこれに新しいです。 –

+1

JDK 1.7のファイルを削除しましたが、出力結果に違うエラーが発生しました:> Practicum 1.2.dll(v7.0)の$(TargetFrameworkVersion)がプロジェクト(v5.1)の$(TargetFrameworkVersion) 。プロジェクトの$(TargetFrameworkVersion)を増やす必要があります。 1>処理中:obj \ Debug \ res \ layout \ main.xml –

+1

私のVSはAndroid 7をターゲットフレームワークとして使用していますが、5.1が必要です。 –

関連する問題