How we can Integrate HMS Kit in Android Studio Bumblebee (2021.1.1) Patch 1)? - huawei-mobile-services

Android Studio Bumblebee (2021.1.1) Patch 1) released on February 4, 2022

Here I am going to discuss you about HMS Kit Integration in Android Studio new version Bumblebee (2021.1.1) Patch 1) which is released on February 4, 2022. There are some changes in project level build.gradle file and settings.gradle. So I am sharing a temporary solution to integrate HMS Kits here.
1) In root build.gradle
There are some changes in root level build.gradle file in new version.
buildscript removed here in new version, where we add Add the AppGallery Connect plugin.
So to integrate HMS Kits add buildscript as given
Note : No need to configure the Maven repository address in root level build.gradle
2) settings.gradle
Few changes are there in settings.gradle. We can find pluginManagement and dependencyResolutionManagement there. Add maven url in both sections as mentioned in below image.
3) App level build.gradle
No other changes in App level build.gradle file. You can add a build dependency in the dependencies block and can add the AppGallery Connect plugin configuration.
That's it.
I know it is a temporary solution, but you can use it till we get a permanent solution.
Thank you.

Related

SOLVED Unity: Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager

Assalamu'alaikum wr wb
Unity version 2020.3.17f1 LTS
Using Photon Fusion
Using PlayFab
I have find this error
How to solve is:
Edit>Project Settings>Player>Publish Setting> Tick Custom Main Gradle Template
Edit>Project Settings>Player>Publish Setting> Tick Custom Launcher Gradle Template
Open Assets>Plugins>Android>mainTemplate.gradle
Open Assets>Plugins>Android>launcherTemplate.gradle
Then both of them change:
buildToolsVersion BUILDTOOLS
to
buildToolsVersion '30.0.3'
Then test build for android Apk or aab
Note: if you find error configuration ':launcher:lintClassPath' then before you build to android please tick Development Build in Build Settings
Wassalamu'alaikum

How can I solve the version of the Android embedding?

I have this problem. Plz let me know how to solve this problem..
I got this git code from a lesson made about 2years ago.
Also different errors showed up when I made a flutter project using git code.
-> This is the problem
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
If you are here because of the flutter 2.10, do this:
Change this:
<application
android:icon="#mipmap/ic_launcher"
android:name="io.flutter.app.FlutterApplication"
android:label="PassesBox"
...
To this:
<application
android:icon="#mipmap/ic_launcher"
android:name="${applicationName}"
android:label="PassesBox"
...
If the application is very old, you should consult the migration guide that the documentation or fial offers you, just like the other answers recommend.
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
but if you still have the deprecated application warnning try the following
step one: delete the cache. flutter clean
step two: remove the pubspec.lock file from the root of the project. rm pubspec.lock
step three: update the libraries if you have any very outdated, you can do it manually or through the command. flutter pub upgrade --major-versions (this command will update all the libraries you have, be careful, before evaluating if such an update is necessary in your project).
then you must make some changes at the android folder level
change the gradle.zip in android/gradle/wrapper/gradle-wrapper.properties to a newer version like:
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
and in android/build.gradle update the version to
classpath 'com.android.tools.build:gradle:7.1.2'
the kotlin version in : ext.kotlin_version = '1.6.10'
and if you were using code obfuscation with proguard-rules.pro
remove any added configurations that reference that file in android/app/build.gradle and you should be left with just this
buildTypes {
release {
signingConfig signingConfigs.release
}
}
finally close the code editor or the IDE you use
and in console run flutter pub get and run your project flutter run
Last but not least, do not forget to update the build version of your application to API 33 or higher and have your android studio updated (VERY IMPORTANT FOR UPDATE, )
android-studio
This has been answered before here on SO.
Here:
Your Flutter application is created using an older version of the Android embedding
And here: How to Fix Flutter Warning: Your Flutter application is created using an older version
You can also look at the source of how to migrate here:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects

No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi

I was working on a Flutter project and everything was working fine until I updated My Android Studio and some of the SDK tools. Then when I was trying to run my project, I was getting the Error below:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
> No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at [https://help.gradle.org](https://help.gradle.org)
BUILD FAILED in 1m 4s
Exception: Gradle task assembleDebug failed with exit code 1
So what have gone wrong? What should I do?
The main reason is that NDK 23 has different toolchain than the previous versions of NDK (22-), so the old version of AGP (Android Gradle Plugin) has not idea where to find the executables for different ABIs.
For me, simply update the AGP version in the build.gradle in your Android project root to 4.0+, such as
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
...
This will resolve the problem.
Note: You will need to set the environment variable ANDROID_NDK_HOME to your NDK 22- location, even Google's document does not require that or says it is deprecated.
If you want to stick to the current version of AGP, there is another work around, simply add this
android {
android.ndkVersion "21.4.7075529" // (or whichever NDK 22- version you have installed)
...
to your module's build.gradle (not the build.gradle of your project)
Some other ways to work around this can be found here, Configure the NDK for the Android Gradle plugin
Well I solved the issue in 2 different ways:
A. I downgraded my NDK from version 23.0.7123448 to 22.0.7026061 by simple steps below:
1.Open SDK Manager from tool bar of android studio or from settings menu (File --> Settings --> Appearance and Behavior --> System Settings --> Android SDK).
Select the SDK Tools tab and from the Bottom Right of the window check the Show package details. Then simply uncheck any version you want to delete and select Apply.
(For me removing version 23.0.7123448 and get to 22.0.7026061 solved the problem. But if you are still having the Error above try to lower the NDK version. The most stable NDK version is 20.1.5948944)
If you have done all the steps before, you will see the following window popping up. Hit OK and you are all set.
B. This approach might look simple but yet it does the trick. Simply create a new Flutter project and get all you work (lib folder, assets, etc) to the new project.
Environment
OS : Big Sur 11.1
npm 7.24.0
node v14.15.5
react-native-cli: 2.0.1
react-native: 0.63.4
Command
react-native run-android
Error
*What went wrong:
Execution failed for task ':app:stripDebugDebugSymbols'.
No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
Fix
Checking Android SDK Tools, NDK (side-by-side):
In the android toolbar go to:
Tools >> SDK Manager
![Tools-SDK][1]
Then in the popup aside navigation go to:
Appearance & Behavior >> System Settings >> Android SDK

Click “SDK Tools”
Check the box next to show package details

Solution:
Downgrade
References
Idea for downgrade: Taba's solution
Here's what worked for me
I updated AGP to 4.1+ in my Android Project root build.gradle
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
...
AGP 4.1+ supports only gradle version gradle-6.5 above
so I updated the distributionUrl in gradle-wrapper.properties file located in gradle/wrapper folder
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Get more info here
what worked for me was
I change my Gradle dependencies from 3.5.1 to 4.0.1
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
}
which is under build.gradle
The minimum Gradle support for Gradle dependencies(gradle:4.0.1) is gradle-6.1.1
if your gradle version for the project is below that you will have to change it by downloading a higher version or if you have it and you're using a wrapper, you will have to change the distribution to the one higher or same as the 6.1.1 version.
which is under >gradle >wrapple >gradle-wrapple.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
You might most likely need to add to your NDK
for Gradle-6.7 the supported NDK is NDK(side by side) version 21.0.6113669
which is under >tools >sdk manager(android SDK) >sdk tools >ndk side by side
click show package details click and download the appropriate one for you
I clean all SDK folders in c:\Users\User\AppData\Local\Android\Sdk\ndk\
Recent AppCenter android dependencies changes caused my android builds to fail with this error:
No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi
Our solution was to upgrade the gradle version from 3.5.4 to 4.0.1 in the root build.gradle file:
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
Additional answer for #gwang and #TillyJonesy:
When running Gradle command with --info(AGP 3.5.4 for me), you will see that when no NDK version was given, AGP will try to use the highest NDK version.
And from the docs of Android NDK guidance, AGP <= 3.5 has no default NDK version.
See: https://developer.android.com/studio/projects/install-ndk#default-ndk-per-agp
Solution for native android developers
Go to File->Settings->Appearance & Behaviour->System Settings->Android SDK-> then select SDK Tools and check 'Show Package Details' from bottom.
in Dropdown of NDK(Side by Side) ,check 22.1.7171670 and uncheck remaining then apply and click ok.

after installing ionic cordova plugin add cordova-plugin-fcm-with-dependecy-updated my android built not working

Error: Execution failed for task ':processDebugGoogleServices'.
Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 10.+.
i want ionic cordova plugin cordova-plugin-fcm-with-dependecy-updated for notification but build is crash after installed this plugin if i remove this plugin then my app is working
i try to use fcm plugin with android 8.0.0 with cordova-plugin-googleplus 7.0.0 and i try with android 7.4.1 and 6.4.0 with cordova-plugin-googleplus 5.2.1
try this!..
step 1 ionic cordova platform rm android
step 2 go to /plugins/cordova-plugin-fcm-with-dependecy-updated/src/android/FCMPlugin.gradle
change like this
buildscript {
repositories {
mavenCentral()
jcenter()
mavenLocal()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.+'
classpath 'com.google.gms:google-services:3.1.+'
}
}
repositories {
mavenCentral()
jcenter()
}
dependencies {
compile 'com.google.firebase:firebase-core:11.4.2'
}
// apply plugin: 'com.google.gms.google-services'
// class must be used instead of id(string) to be able to apply plugin from non-root gradle file
apply plugin: com.google.gms.googleservices.GoogleServicesPlugin
step 3 ionic cordova platform add android
step 4 Goto /platforms/android/project.properties
Change like the numbers into 11.4.2
cordova.system.library.3=com.google.firebase:firebase-core:11.4.2
cordova.system.library.4=com.google.firebase:firebase-messaging:11.4.2
cordova.system.library.7=com.google.android.gms:play-services-auth:11.4.2
cordova.system.library.8=com.google.android.gms:play-services-identity:11.4.2
demo project.properties file
# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system edit
# "ant.properties", and override values to adapt the script to your
# project structure.
#
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-badge/mobile-badge.gradle
cordova.system.library.2=com.facebook.android:facebook-android-sdk:4.25.0
cordova.system.library.3=com.google.firebase:firebase-core:11.4.2
cordova.system.library.4=com.google.firebase:firebase-messaging:11.4.2
cordova.gradle.include.2=cordova-plugin-fcm-with-dependecy-updated/mobile-FCMPlugin.gradle
cordova.system.library.6=com.android.support:appcompat-v7:25.+
cordova.system.library.7=com.google.android.gms:play-services-auth:11.4.2
cordova.system.library.8=com.google.android.gms:play-services-identity:11.4.2
cordova.gradle.include.3=cordova-plugin-local-notification/mobile-localnotification.gradle
cordova.gradle.include.4=cordova-plugin-telerik-imagepicker/mobile-ignorelinterrors.gradle
cordova.gradle.include.5=cordova-plugin-telerik-imagepicker/mobile-androidtarget.gradle
cordova.gradle.include.6=phonegap-plugin-barcodescanner/mobile-barcodescanner.gradle
cordova.system.library.11=com.android.support:support-v4:27.+
cordova.gradle.include.7=twitter-connect-plugin/mobile-twitter.gradle
cordova.system.library.12=com.squareup.okhttp3:okhttp:3.12.0
step 5 ionic cordova build android
Note :: Don't forgot to add google-services.json file in root directory, main_project/google-services.json
We have the same issue and yesterday we solve this problem with this answer:
Answer:1
This is due to the firebase updates on April 05. Here https://firebase.google.com/support/release-notes/android#update_-_april_02_2019, I found the last working versions and adjusted my project.properties accordingly like so
cordova.system.library.4=com.google.firebase:firebase-core:16.0.8
cordova.system.library.5=com.google.firebase:firebase-messaging:17.5.0
cordova.system.library.6=com.google.firebase:firebase-config:16.4.1
cordova.system.library.7=com.google.firebase:firebase-perf:16.2.4
Here all dependencies are locked to the specific version (Update - April 02, 2019) instead of +, which would get you the latest version thus breaking the build process.
Now I can build successfully! I hope it helps!
Ref: page
Answer: 2
A wonderful person opened a pull request 31 in the cordova-firebase-plugin official repo and it works.
Steps I did:
1 - Remove cordova-firebase-plugin with ionic cordova plugin remove cordova-
firebase-plugin
2 - Install: ionic cordova plugin add https://github.com/dpa99c/cordova-plugin-firebase#GH-1057-April-05-android-build-issue
3 - rm -rf node_modules/ plugins/ platforms/android package-lock.json
4 - ionic cordova platform add android && npm install
5 - In my case, I also use a firebase js library in an old version because the newest ones are not working for me. With that library I always need to reinstall it manually after all the previous steps, so also I did: npm install firebase#4.12.1.
And now it’s working.
ref: Page
I'm a Korean who develops with Cordova
I solved as below.
cordova-plugin-admob-free and
Library conflict with cordova-plugin-fcm-with-dependecy-updated.
I changed only the ads version and ran it as shown below.
I am not sure if the content will be delivered using Google Translate.
enter image description here
/platforms/android/project.properties
cordova.system.library.1=com.google.firebase:firebase-core:16.0.9
cordova.system.library.2=com.google.firebase:firebase-messaging:18.0.0
cordova.gradle.include.1=cordova-plugin-fcm-with-dependecy-updated/helloworld-FCMPlugin.gradle
cordova.system.library.3=com.google.android.gms:play-services-base:11.0.4
cordova.system.library.4=com.google.android.gms:play-services-ads:17.0.0

Not able to sync dependency in build.gradle in flutter

I want to use some native library. and I am using below dependnecy
implementation 'com.google.android.gms:play-services-vision:10.+'
in build.gradle in flutter project.
How I will sync that dependency. Please help me!
If you're using Android Studio for Flutter development, right click on the android folder in your Flutter project. Select "Flutter" -> "Open Android Module in Android Studio".
Or
Simply start Android Studio and open the Android (sub)project directly.
In any case, once the Android project is opened in Android Studio, you can make changes in your build.gradle. The editor will tell you to sync. Otherwise simply execute a build. Afterwards you will be able to import use your Android classes.
That is the problem with gradle sync of Android project, not with Flutter dependencies.
In your build.gradle of your module (for example android/app/build.gradle of your Flutter project) add:
implementation 'com.google.android.gms:play-services-vision:10.+'
in dependencies as bellow:
dependencies {
implementation 'com.google.android.gms:play-services-vision:10.+'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
Then open terminal, cd to android folder of your flutter project and run:
$./gradlew build
After that you will be able import com.google.android.gms... in your Java class.
Go to android folder of your flutter project and then
open it in terminal by right clicking on that folder
then try to run below command
gradlew build
i know i am late but let me suggest the way as per i done and it's working , if it helps to someone
Open android studio flutter project
Go to file
Click on setting
Search for "Flutter"
at bottom of that view there is an experiments section do check that both checkbox
after doing this add any dependencies in android gradle and go to file and click on "Sync with file system" and you are done , please check the below screenshot to do check the experiments item
I managed to sync the dependencies using "Run Configurations". Please follow next screenshots:
Open Gradle tab.
Select path to Build.Gradle file.
Double click to sync.
For me it was the kotlin version being specified in the build.gradle, which wasn't in sync with the IDE's version. Changed it from ext.kotlin_version = '1.4.32' to ext.kotlin_version = '1.5.20'. Now it is syncing the gradle script again.