2016-09-09 8 views
0

サーバーから送信されたn個のgpsデータの位置を示すアンドロイドマップを既に作成しています。最初はサーバーapiから場所を表示し、アプリとアプリケーションのみに送信しますそれを表示します..アンドロイドスタジオのマップボックスAPIをインポートする際にエラーが発生しました

今私はアプリが受け取る場所に基づいてマーカーを更新するネイティブマップを実装する必要があります。 私はmapboxのAPIを発見し、それを使用しようとしたが、コンパイルには、特定のエラーが発生します。..誰もがそれをクリアするために私を助けることができます。..

私gradle.build(アプリ)

apply plugin: 'com.android.application' 
android { 
    compileSdkVersion 22 
    buildToolsVersion '24' 

    defaultConfig { 
     applicationId "com.juasoft.safebus" 
     minSdkVersion 16 
     targetSdkVersion 22 
     versionCode 1 
     versionName "1.0" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    compile 'com.leo.simplearcloader:simplearcloader:1.0.+' 
    compile 'com.android.support:appcompat-v7:22.1.1' 
    compile 'com.jakewharton:butterknife:6.1.0' 
    compile 'com.android.support:support-v4:22.1.1' 
    compile 'com.android.support:recyclerview-v7:22.1.1' 
    compile('com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE') 
    compile 'com.github.amlcurran.showcaseview:library:5.4.3' 
    compile 'com.github.gabrielemariotti.cards:library:1.9.1' 
    compile 'com.google.firebase:firebase-core:9.0.2' 
    compile 'com.google.firebase:firebase-messaging:9.0.2' 
    compile 'com.github.clans:fab:1.6.4' 

} 
repositories { 
    mavenCentral() 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    // add the Mapbox SDK dependency below 
    compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]'){ 
     transitive=true 
    } 
} 
apply plugin: 'com.google.gms.google-services' 

ERROR:

****/app/build/intermediates/res/merged/debug/values-v23/values-v23.xml 
Error:(4) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'. 
Error:(33) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'. 
Error:Execution failed for task ':app:processDebugResources'. 
> com.android.ide.common.process.ProcessException: Failed to execute aapt 

V23 /値-v23.xml

<?xml version="1.0" encoding="utf-8"?> 
<resources> 
    <style name="Base.TextAppearance.AppCompat.Widget.ActionBar.Menu" parent="android:TextAppearance.Material.Widget.ActionBar.Menu"/> 
    <style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="android:TextAppearance.Material.Widget.Button.Inverse"/> 
    <style name="Base.Theme.AppCompat" parent="Base.V23.Theme.AppCompat"/> 
    <style name="Base.Theme.AppCompat.Light" parent="Base.V23.Theme.AppCompat.Light"/> 
    <style name="Base.V23.Theme.AppCompat" parent="Base.V22.Theme.AppCompat"> 
     <!-- We can use the platform styles on API 23+ --> 
     <item name="ratingBarStyleIndicator">?android:attr/ratingBarStyleIndicator</item> 
     <item name="ratingBarStyleSmall">?android:attr/ratingBarStyleSmall</item> 

     <!-- We can use the platform drawable on v23+ --> 
     <item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item> 
     <!-- We can use the platform styles on v23+ --> 
     <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item> 
     <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item> 

     <item name="controlBackground">@drawable/abc_control_background_material</item> 
    </style> 
    <style name="Base.V23.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light"> 
     <!-- We can use the platform styles on API 23+ --> 
     <item name="ratingBarStyleIndicator">?android:attr/ratingBarStyleIndicator</item> 
     <item name="ratingBarStyleSmall">?android:attr/ratingBarStyleSmall</item> 

     <!-- We can use the platform drawable on v23+ --> 
     <item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item> 
     <!-- We can use the platform styles on v23+ --> 
     <item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item> 
     <item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item> 

     <item name="controlBackground">@drawable/abc_control_background_material</item> 
    </style> 
    <style name="Base.Widget.AppCompat.Button.Colored" parent="android:Widget.Material.Button.Colored"/> 
    <style name="Base.Widget.AppCompat.RatingBar.Indicator" parent="android:Widget.Material.RatingBar.Indicator"/> 
    <style name="Base.Widget.AppCompat.RatingBar.Small" parent="android:Widget.Material.RatingBar.Small"/> 
    <style name="Base.Widget.AppCompat.Spinner.Underlined" parent="android:Widget.Material.Spinner.Underlined"/> 
</resources> 

答えて

1

問題は、コンパイルSDKのバージョンがサポートライブラリのメジャーバージョンと一致しないためです。 の両方が24または22のいずれかである必要があります。これでエラーが解決されるはずです。

この問題はMapboxとは関係ありませんが、2つの依存関係を組み合わせてbuild.gradleをクリーンアップすることができます。それは次のようになります:

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.leo.simplearcloader:simplearcloader:1.0.+' 
compile 'com.android.support:appcompat-v7:22.1.1' 
compile 'com.jakewharton:butterknife:6.1.0' 
compile 'com.android.support:support-v4:22.1.1' 
compile 'com.android.support:recyclerview-v7:22.1.1' 
compile('com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE') 
compile 'com.github.amlcurran.showcaseview:library:5.4.3' 
compile 'com.github.gabrielemariotti.cards:library:1.9.1' 
compile 'com.google.firebase:firebase-core:9.0.2' 
compile 'com.google.firebase:firebase-messaging:9.0.2' 
compile 'com.github.clans:fab:1.6.4' 
testCompile 'junit:junit:4.12' 

// add the Mapbox SDK dependency below 
compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:[email protected]'){ 
    transitive=true 
} 
} 
関連する問題