DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: webb123
今日帖子: 34
在线用户: 20
导航: 论坛 -> 移动应用开发 斑竹:flyers,iamdream  
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 20:36:29
标题:
Google play 发布,必须要 API 30 浏览:2392
加入我的收藏
楼主: Delphi 10.4.2 带来的是 API 29;

要安装新的安卓 SDK,但官方下载页面和其它搜出来的介绍网页都说是要安装 Android Studio。这个玩意太大,不安装它,哪里有单独下载 Android SDK 支持到 Android 11 和 API 30 的?
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 21:07:49
1楼: Delphi 10.4.2 带来的 Android SDK Manager 运行后,里面最高只有 Android 10 / API 29,想让它去安装 API 30 没地方可以勾选。
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 21:25:37
2楼: 官方网站如此说:

获取 Android 11 SDK
安装并打开 Android Studio 后,请按以下步骤安装 Android 11 SDK:

依次点击 Tools > SDK Manager。
在 SDK Platforms 标签页中,选择 Android 11。
在 SDK Tools 标签页中,选择 Android SDK Build-Tools 30(或更高版本)。
点击 OK 开始安装。

----------
不想安装 Adroid studio,太大,电脑空间不够。哪里有单独下载 SDK 的?
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 22:25:50
3楼: 发现一个办法,执行中,还没完成。

C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203  这个目录应该是目前我的 SDK 的根目录

这个目录底下,有 2 个 SDKManager.bat 命令行文件。

第一个是在:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\cmdline-tools

这个不能用。一执行就出问题。

第二个在:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\tools\bin

在命令行底下执行这个,原本在:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms
这里只有一个 Android-29

现在我执行这个 BAT ,加上参数:sdkmanager "platform-tools" "platforms;android-30",果然在这个 platforms 底下出现 Android-30 的目录了。

另外,在这个目录底下:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203

有一个 SDK Manager.exe 是一个有 UI 界面的程序,它就只能显示一堆你安装没安装的 SDK,但最多就到 Android 10,没有 11。
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 22:27:47
4楼: 按照上述办法安装成功。打开那个有 UI 界面的 SDK Manager.exe,也能看到Android 11(API 30)这个项目了。之前这个界面里面看不到的。
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/21 22:55:51
5楼: 忙了半天,终于有 Android-30 了。也在 UI 界面的 SDK Manager 里面看到 API 30 了。也修改了 Delphi IDE / tools /options / deployment / SDK Manager 里面的 

Android 64 bit 里面的 SDK API-Level location 指向 platforms / Android-30 这个目录了。

重新彻底 build 然后重新 deploy 出来的 aab 文件,放到 google play 里面去,仍然还是提示:

Your app currently targets API level 29 and must target at least API level 30 to ensure it is built on the latest APIs optimized for security and performance. Change your app's target API level to at least 30. Learn More
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/11/21 23:21:07
6楼: Let's try understand it:

1) any Android SDK is not REALLY installed (like a any other software MSWindows)

2) you can "JUST COPY" any Android SDK directory from any other computer for your computer  (it is not really installed, just copyed)

3) all installation done under GetIt is:
a) downloaded from Embarcadero or third-part like a zip or exe
b) this file will be saved on ..\Public\...Embarcadero...CatalogueRepository, then, you can try re-run it again if any fail on GetIt install (of course, if GetIt dont delete it)

4) Android Studio is really not necessary for update Android SDK on RAD Studio, but it help in download last updates
a) you can use tool SDKManager.exe/bat on SDK Android MSWindows installed by RAD Studio (if it exist, of course)
b) In last editions, RAD Studio is forcing GetIT use, then, just only some files from SDK Android is installed by default, the TOOLS needs to be donwloaded and updated for last updates, as  necessary.
c) RAD Studio show that SDK Android you need have for each RAD Studio edition, then, any other can dont works as expected.

5) if you downloaded Android Studio for update your Android SDK to RAD Studio, you can:
a) in Android Studio, update all SDK Android that you need. each one for a folder for easy indentification
.... skd29
.... sdk30 etc...

the name or drive/directory is not very important. you can use any one

my advice:
-- try dont use "c:\program files or (x86)" (always needs privilegies "ADMIN") as target to install your softwares  
----- use any other target, like C:\MySDKsAndroid    <-- dont needs any privilegies of "Admin"



b) you can copy this folders (SDK's) for you driver and root desired, like me:
d:\MySDKsAndroid\
....SDK1
....SDK2 etc...

c) if you choice install all components from SDK Android, then, you can:
1) copy each folder SDK for you drive/directory desired
2) uninstall Android Studio from your computer
3) delete any residual of Android Studio of your computer

d) now, you can just say to RAD Studio where is the SDK Android that it can use.

e) as each SDK Android was updated to "full" files, then, each SDK will have "tools" necessary for next updates... or be, you will have the "SDKManager" for run and update it again if necessary.


you see?
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 0:01:26
7楼: Hi @emailx45,

here is what I did:

1. I have installed Delphi 10.4.2 CE on my computer.

2. Delphi IDE menu: tools / options / deployment / sdk manager / android, there is a option that is "API Level". Its value is:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-29

So, according to this path, I guess it is installed by Delphi. 
And Delphi can compile Android App. So this path is the right path about Android SDK.

3. Under the same path, C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\
There is a GUI program named: "SDK Manager.exe", run it, I can see there is a list that include some package:

Android R(API 29, R Preview)
Android 10(API 29)
Android 9(API 28)
etc..

There is no Android 11(API 30)

4. In the same path:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\tools\bin

there is a file named "sdkmanager.bat", I run it by some parameters like:
sdkmanager.bat --"platform-tools" "platforms;android-30", its works fine. And then, I got this:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-30

Beofre, my compunter just exists this:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-29

5. run GUI programe "SDK Manager.exe" again, and I can see:
Android 11(API 30) in there.So, it seems works.

6. Go to Delphi IDE menu tools / options / ... / SDK Manager, I changed the API Level location option let it to the new Android-30 directory:
C:\Users\Public\Documents\Embarcadero\Studio\21.0\CatalogRepository\AndroidSDK-2525-21.0.40680.4203\platforms\android-30

7. Re-build APP and deploy it, Delphi create a new AAB file.

8. upload this file to google play, it says this file is compile on API 29.

So, the fact is:
1. Android SDK is there, otherwise delphi can not create AAB file;
2. through run "sdkManager.bat",install Android 11(API 30) has successed. No error message. and can check it in GUI tool "SDK Manager.exe".
3. In Delphi IDE set the "SDK API-level location " to new directory OK.

Are there any other things I missed ?

Or it is not just about API-level and there are some other Android package needed?
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 0:11:41
8楼: Maybe this is the reason:

In my project directory, ProjectFile\Android64\Release, there is a AndroidManifest.xml,there is a string about API level, that is:

<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="29" />

If I edit it, change 29 to 30 and I re-build this project, it becames 29 again.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/11/22 0:42:50
9楼: AndroidManifest.template.xml used to generate AndroidManifest.xml final on app

按此在新窗口浏览图片
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 1:19:01
9楼: if modify AndroidManifest.template.xml, set its "android:targetSdkVersion="30"", then build success, and deploy fail.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/11/22 1:24:54
10楼: in your system:
sdkmanager.bat --list_installed --sdk_root=d:\MySDKroot_dir

for updates:
sdkmanager.bat --list --sdk_root=d:\MySDKroot_dir

ex.:

sdkmanager.bat --sdk_root=d:\MySDKroot_dir "build-tools;31.0.0" "cmdline-tools;latest" "ndk;23.1.7779620" "patcher;v4" "platform-tools" "platforms;android-31" "skiaparser;2" "sources;android-31" "system-images;android-31;default;arm64-v8a"
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 1:31:56
11楼: The same operation, it is works.

Re-Start Delphi, New a Project, just blank FMX project,

modify AndroidManifest.xml, set android:targetSdkVersion="%targetSdkVersion%" to android:targetSdkVersion="30",

and then build and deploy, got a testAndroid_11.aab file success.

and upload it to google play, got success.

So, the same operation, why the prior project can not work?
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 1:42:20
12楼: I got the reason.

Basically, just modify AndroidManifest.template.xml, set android:targetSdkVersion="%targetSdkVersion%" to android:targetSdkVersion="30", it works.

I have got some error message, because the AndroidManifest.template.xml I modified, I have added some remarks just like "<!-- -->", but it is error format.
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 1:43:21
13楼: Thanks emailx45.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/11/22 1:43:50
13楼: ok. if you get it.. please let us know about it.

hug
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 2:10:19
14楼: there are two config:
1. IDE menu: Tools / options / deployment / sdk manager/ android 64 bit.
Change API-level path to "Android-30" folder;

2. Under project folder, modify AndroidManifest.template.xml, update this:
android:targetSdkVersion="%targetSdkVersion%" to android:targetSdkVersion="30", force it use API-30 but 29.

And we can get it.
----------------------------------------------
-
作者:
男 emailx45 (emailx45) ▲▲▲▲△ -
普通会员
2021/11/22 2:18:40
15楼: stored!

thanks
----------------------------------------------
The higher the degree, the greater the respect given to the humblest!RAD 11.3
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/22 2:34:52
16楼: 写了一份总结:

https://blog.csdn.net/pcplayer/article/details/121463799
----------------------------------------------
-
作者:
男 pcplayer (pcplayer) ★☆☆☆☆ -
普通会员
2021/11/25 20:03:36
17楼: 一堆问题,终于搞定到最后。

之一:
https://blog.csdn.net/pcplayer/article/details/121463799

之二:
https://blog.csdn.net/pcplayer/article/details/121544777
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行97.65625毫秒 RSS