問題描述
我正在嘗試使用此 示例
我不知道它是否會起作用.我在SDK中下載了Google Play服務(wù),但我不知道我必須將它粘貼到哪里,我嘗試了很多地方,但都不成功,總是得到
I have no idea if its going to work. I downloaded Google Play services in SDK, but I have no clue where I have to stick it into, I tried many places, but unsuccessfully, always get
error: package com.google.android.gms.ads.AdView does not exist
以及其他軟件包.我為我對 android sdk 的無知而道歉,但我正在努力更好地理解它,所以我需要一些幫助.我需要知道我必須把google-play-services_lib"放在哪里,這樣它才能找到它.謝謝!
and other packages as well. I apologize for my ignorance of android sdk, but I'm trying to understand it better, so I need some help. I need to know where I have to put 'google-play-services_lib' so it would find it. Thanks!
解決它,將其添加到buildozer.spec":
solved it, adding this to 'buildozer.spec':
# (list) Android library project to add (will be added in the
# project.properties automatically.)
android.library_references = libs/google-play-services_lib
但還是報錯:
.../android-sdk-21/tools/ant/build.xml:539: Unable to resolve project target 'android-9'
這是這一行:
<gettarget
androidJarFileOut="project.target.android.jar"
androidAidlFileOut="project.target.framework.aidl"
bootClassPathOut="project.target.class.path"
targetApiOut="project.target.apilevel"
minSdkVersionOut="project.minSdkVersion" /> # line 539!!!
推薦答案
這也解決了,抱歉我在這里弄得一團糟,問和回答我自己的問題,但我認為這對 Kivy 用戶來說是一個重要的話題,網(wǎng)上也沒有太多關(guān)于這個的.所以,解決方案:我在google-play-services_lib"內(nèi)的ant.properties"文件中手動將項目目標"設(shè)置為android-14".它拋出錯誤,因為 google play 服務(wù)庫是針對較新的 android api 的.
And that solved as well, sorry for the mess I've made here, asking and answering my own questions, but I think it's an important topic for Kivy users, and there's not much about this on the net. So, solution: I manually set project 'target' to 'android-14' in 'ant.properties' file inside 'google-play-services_lib'. It was throwing error because the google play services library was for newer android api.
無論如何,對于任何好奇這是否有效(在 Android 的 Kivy 應(yīng)用程序中實現(xiàn)廣告)的人,是的,它有效,但我不得不重寫原始解決方案以支持新庫(使用 本指南)
Anyway, for anyone curious if that worked (implementing ads into Kivy app for Android), YES it worked, I had to rewrite the original solution to support new library though (using this guide)
這篇關(guān)于Kivy 和 Google Play 服務(wù)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!