1> JAVAC:警告:添加xamari.support.v4和xamarin.support.v7.AppC后,xamarin.android中的未知枚举常量Scope.LIBRARY_GROUP

时间:2017-02-28 14:45:02

标签: xamarin.android

练习启动时屏幕我添加xamarin.support.v4包和xamarin.android.v7.appcompat每个瘦都没关系我刚收到警告1> JAVAC:警告:未知枚举常量Scope.LIBRARY_GROUP 我的代码运作良好: 我的启动活动代码是:

enter code here
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Android.App;
using Android.Content;
using Android.OS;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.Support.V7.App;
using System.Threading.Tasks;
using Android.Util;
namespace againCardview
{
[Activity(Label = "SplashActivity",MainLauncher =true,NoHistory                   =true,Theme = "@style/MyTheme.Splash")]
public class SplashActivity :AppCompatActivity
{
    string tag = "TAg" + typeof(SplashActivity).Name;
    public override void OnCreate(Bundle      savedInstanceState,PersistableBundle persist)
    {
        base.OnCreate(savedInstanceState,persist);
        Log.Debug(tag, "this is Oncreate method of splashActivity");
    }
    protected override void OnResume()
    {
        base.OnResume();
        var setartActivity = new Task(()=> {
            Log.Debug(tag, "Now App is starting");
            Task.Delay(50000);
            Log.Debug(tag, "now performing importing work");
        });
        setartActivity.ContinueWith(p => {
            Log.Debug(tag, "Starting App");
            StartActivity(new Intent(Application.Context,      typeof(MainActivity)));
        },TaskScheduler.FromCurrentSynchronizationContext());

    }
}

}

2 个答案:

答案 0 :(得分:4)

现在我通过在app / build.gradle依赖项中回滚到以前版本的Google Play服务来解决这个问题。在更新到最新的库之后,这个问题发生在我身上,但是它消失了:

dependencies {
    // there is a problem using 25.2.0: Warning:unknown enum constant Scope.LIBRARY_GROUP
    compile 'com.android.support:appcompat-v7:24.2.1'
    compile 'com.android.support:design:24.2.1'
    compile 'com.android.support:support-v4:24.2.1'
    compile 'com.android.support:cardview-v7:24.2.1'
    compile 'com.android.support:recyclerview-v7:24.2.1'
    compile 'com.android.support:support-vector-drawable:24.2.1'
    compile 'com.android.support:support-annotations:24.2.1'
}

答案 1 :(得分:1)

修复它下载xamarin.Android.Support.V7.AppCompat 24.2.1。