2016-12-08 7 views
15

Ionic docs as seen hereを使用してGoogle Maps APIを実装しようとしています。Ionic v2 Google Maps API Androidビルドエラー:AbstractSafeParcelable options.compassEnabledにアクセスできません(controls.getBoolean( "compass"));

私は与えとおりにコードサンプルを使用していますが、私は次のエラーを取得しています:

BUILD FAILED 

Total time: 2.748 secs 

Error: /path/to/platforms/android/gradlew: Command failed with exit code 1 Error output: 
/path/to/platforms/android/src/plugin/google/maps/GoogleMaps.java:479: error: cannot access AbstractSafeParcelable 
     options.compassEnabled(controls.getBoolean("compass")); 
      ^
    class file for com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelable not found 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
1 error 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':compileDebugJavaWithJavac'. 
> Compilation failed; see the compiler error output for details 

は/見た誰もがこの問題を解決しましたか?

答えて

44

私はこの問題を解決できました。不足しているリポジトリ(Androidサポートリポジトリ、ライブラリ、Playサービス、Googleリポジトリが必要です)をインストールすることについて多くの提案がありましたが、私はそのすべてを備えていました。私はプラグインを追加するには、このコマンドを使用する場合、どのような間違ったバージョン管理がproject.propertiesで指定されたことが欠けていた。これに

cordova.system.library.4=com.google.android.gms:play-services-maps:9.8.0 
cordova.system.library.5=com.google.android.gms:play-services-location:9.8.0 

:project.propertiesで

ionic plugin add cordova-plugin-googlemaps --variable API_KEY_FOR_ANDROID="YOUR_ANDROID_API_KEY_IS_HERE" --variable API_KEY_FOR_IOS="YOUR_IOS_API_KEY_IS_HERE" 

を、私はこれを変更し

cordova.system.library.4=com.google.android.gms:play-services-maps:+ 
cordova.system.library.5=com.google.android.gms:play-services-location:+ 

ビルドエラーを解決しました。

+0

また、Google Playサービスバージョン10.0以上を実行できるエミュレータを使用する必要があります。私にとってこれはGoogle API SDK(現在はAndroid 7.0、SDKマネージャーのSDK 24に記載されている)をインストールし、それをエミュレータのベースイメージとして使用することを意味していました。 –

+0

これは私の問題を解決するものではありません。プラグイン/グーグル/マップ/ PluginUtil.java:135:エラー:AbstractSafeParcelableにアクセスできません Builder builder = LatLngBounds.builder(); ^ com.google.android.gms.common.internal.safeparcel.AbstractSafeParcelableのクラスファイルが見つかりません –

+1

これは私の場合の問題を解決しました。 –

関連する問題