2017-02-28 126 views
1

在練習splash時屏幕我添加了xamarin.support.v4包和xamarin.android .v7.appcompat每一個瘦是好的,我剛剛警告1> JAVAC:警告:未知的枚舉常量Scope.LIBRARY_GROUP 和我的代碼運行良好: 我潑活動的代碼是:1> JAVAC:警告:未知枚舉常量xamarin.android中的Scope.LIBRARY_GROUP在添加xamari.support.v4和xamarin.support.v7.AppC後

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()); 

    } 
} 

}

+0

這對我沒有幫助我已經嘗試安裝以前版本的軟件包,但沒有改進,請建議我更好的解決方案 –

+0

我的應用程序未加載下一個活動,即MainActivity它只是顯示啓動畫面 –

回答

3

現在我通過在應用程序/ build.gradle d中回滾到之前版本的Google Play服務來解決此問題ependencies。這個問題發生在我身上更新到最新的庫之後,但這種消失:

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' 
} 
+0

如果您使用材料設計設置修復,你也需要更新。 //使用材料設計破解的設置 // https://github.com/Gericop/Android-Support-Preference-V7-Fix compile('com.takisoft.fix:preference-v7:24.2.1.0' ){ 排除組:'com.android.support',模塊:'appcompat-v7' } –

1

修復它下載xamarin.Android.Support.V7.AppCompat 24.2.1。