Tag Archives: sdk

[Solved] Failed to install the following Android SDK packages as some licences have not been accepted

Question:
Using the Android SDK outside of Android Studio may explode with the following error

Failed to install the following Android SDK packages as some licences have not been accepted.
patcher;v4 SDK Patch Applier v4
emulator Android Emulator
platforms;android-30 Android SDK Platform 30
tools Android SDK Tools
build-tools;29.0.2 Android SDK Build-Tools 29.0.2
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

Solution:
input. /sdkmanager --licenses in android/sdk/tools/bin
After authorization you can

[Solved] Ubuntu20.04 Error: “Failed to install the following Android SDK packages as some licences have not..“error

After installing Android studio under Ubuntu, importing the project and building, the following error appears:

The problem is that licenses are not matched well

There are only two steps to solving the problem:

1. Open file – & gt; Settings

After the settings interface appears, enter appearance – & gt; System Settings -> Android SDK -> SDK Tools

Download Android SDK command line tools (latest) in SDK tools interface

2. After downloading, CMD line tools will be installed in the SDK directory ~/Android/SDK by default. If your directory is different, you need to modify it accordingly

Execute on the command line

yes | sudo ~/Android/Sdk/cmdline-tools/latest/bin/sdkmanager --licenses

The problem is solved. Build can run normally

Note: 1. In some articles, you can directly run the sdkmanager under ~/Android/SDK/tools/bin /, which will report an error

 java.lang.NoClassDefFoundError

The reason is that Ubuntu 20.04 installs OpenSDK 11 by default, which will conflict with the JRE that comes with Android Studio.
Uninstalling OpenSDK 11 and installing a lower version of JavaSDK is more troublesome.

Android studio error Error:Could not Determine java version from ‘9.0.4’

The beginning of the matter is to export an APK with signature package and report an error Error:Execution failed for task ‘: app:compileReleaseJava ‘& gt; cannot find sys

At that time, my default setting location did not point to the correct JDK path, so an error was reported. Since I haven’t found my previous JDK for a long time, I went to the next version of JDK (9.0.4). Please pay attention to the latest version.

Then I try to export again and report an error: Error:Could not Determine java version from ‘9.0.4’

Then try again and continue to report errors Error:Gradle version 2.2 is required. Current version is 4.6. If using the gradle wrapper, try editing the distributionUrl in /Users//Desktop/gradle/wrapper/gradle- wrapper.properties to gradle-2.2- all.zip … because of the error caused by the inconsistency between the gradle version and the gradle version of as, modifying the gradle configuration file (there are many detailed solutions on the Internet) is of no use to me… Because after the change, an error is reported: could not initialize class com.android.repository . api.RepoManager Well, I gave up.

I began to think about why I encountered this series of problems at the beginning, right! Because of the latest version of JDK! So, I went to download a 1.8.0 JDK (download address), download and install it, change the JDK location of Android studio (Figure), and then gradle changed back to the old version, APK signature package export, success!!

So why should I download the latest JDK?:)

Common mistakes and solutions of cmake + QT + VTK

1. Installation environment
Cmake3.0 + QT4.8.6 + VTK5.10
PS.VTK6.10 or above can only be used with QT5.0 or above versions
2. Compile and install
Reference: http://blog.csdn.net/www_doling_net/article/details/8532742
3. Common mistakes
1, Could not find a package configuration file provided by “Qt5Widgets” with
any of the following names:

Qt5WidgetsConfig. Cmake
Qt5Widgets – config. Cmake

Add the installation prefix of “Qt5Widgets” to CMAKE_PREFIX_PATH or set
“Qt5Widgets_DIR” to a directory containing one of the above files. If
“Qt5widgets” provides a separate development package or SDK, be sure it has
been installed.
This error is generally caused by the incorrect selection of the version number of Qt. Carefully check whether the version number of Qt is 4 or 5. We can solve it.
2

Failing to find Glu32 is usually due to the wrong path. Be careful to check the installation path.
3. There are a lot of things you can’t select from the CMake process, such as the build file. You have to install something in order to be able to cmake, so try to follow the tutorial as much as possible.
What problems can leave a message below, a lot of problems, have not been able to recall in time.

””Device not found” error causes and Solutions

This is a common error you may encounter when using SQLite in Android development.
See this in conjunction with my other article, “ADB is not an internal or external command, nor is it an executable application.”
Executing ADB shell under CMD. It is likely that your ADB version is low. (You can view your version of ADB with the adb version command.)
Here’s how to solve this problem.
Open the Android SDK Manager in Eclipse, upgrade the SDK Platform, and download the Google USB Driver. As shown in the figure below:


At this point, the problem is solved by executing adb.exe again.

Change API level Android studio

Changing API Level Android Studio
I want to change the minimum SDK version in Android Studio from API 12 to API14. I have tried changing it in the manifest file, ie, I want to change the minimum SDK version in Android Studio from API 12 to API14. I tried to make the change in the manifest file, which is

<uses-sdk
    android:minSdkVersion="14"
    android:targetSdkVersion="18" />

and rebuilding the project, but I still get the Android Studio IDE throwing up some errors. and rebuild projects, but I still get the Android Studio IDE throw out some mistakes. I presume I have to set the min SDK in ‘project properties’ or something similar so the IDE recognizes the change, But I can’t find where this is done in Android Studio. I think I have to set the min SDK in project properties or something similar so that the IDE can recognize changes, but I can’t find anything done in Android Studio.


# 1/f,
Reference: https://stackoom.com/question/1JfkP/ change the Android API level – Studio


# 2 floor
For me what worked was: (right click)project-> android tools-> Clear lint markers. , for me, markers that have worked are :(right click) markers -> The android tools – & gt; Remove lint marks. Although for some reason the Manifest reverted to the old (lower) minimum API level, But after I changed it back to the new (higher) API level there was no red error underline and the project now USES the new minimum API level. although for some reason the list has been restored to the old (lower) minimum API level, But after I changed it back to the new (higher) API level, there was no red error underscore, and the project now USES the new lowest API level.
Edit: Sorry, I see you were using Android Studio, not Eclipse. Edit: Sorry, I see you are using Android Studio, not Eclipse. But I guess there is a similar ‘clear lint markers’ in Studio somewhere , which I think might be able to solve the problem.


The # 3 floor
As well as updating the manifest, update the module’s build.gradle file too (it’s listed in the project pane just below the manifest – if there’s no minSdkVersion key in it, you’re looking at the wrong one, Gradle build. Gradle file for the module (list this file in the project pane at the bottom of the list – if there is no minSdkVersion key in it, then you have entered the wrong key because there are several). A rebuild and things should be fine… rebuild, everything should be fine…


# 4 floor
When you want to update your minSdkVersion in an existent project… when you want to update your minSdkVersion in an existing project…

    Update build. Gradle (Module: app)-make sure is the one under gradle 4 build and it is NOT build. Gradle (Project: yourproject) Update build. Gradle (Module: app) App) - make sure it's the one under Gradle Script, not build. Gradle (Project: yourproject).

An example of build.gradle: build.gradle :

apply plugin: 'com.android.application'

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.2"

    defaultConfig {
        applicationId "com.stackoverflow.answer"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}

dependencies {
    androidTestCompile 'junit:junit:4.12'
    compile fileTree(dir: 'libs', include: ['*.jar'])
}
    Sync gradle button (refresh all gradle projects also works) synchronous gradle button (refresh all gradle projects can also work)

For beginners in Android Studio "Sync gradle button" is located in Tools -> Android -> Sync Project with Gradle Files "Rebuild project" Build -> Rebuild Project for beginners in Android Studio, the "sync gradle button" is located in the tool -> Android-> Use Gradle file to synchronize the project "Rebuild Project" build-& gt; Rebuild Project

    Rebuild project Rebuild project

After updating the build.gradle 's minSdkVersion , You have to click on the button to sync gradle file (" sync Project with gradle files"). update build. After gradle minSdkVersion, you must click on the button gradle sync file (' sync Project with cradle files'). That will clear the marker. this will clear the marker.
Updating manifest.xml, for eg deleting any references to SDK levels in the manifest file, is NOT necessary anymore in Android Studio. ; Updating manifest.xml is NOT necessary. For example, remove any references to the SDK level in the manifest file.


The # 5 floor
For android studio users: For android studio users:

    right click the App directory right-click App directory choose the "module setting" option select "module Settings "option change the ADK Platform as what you need0 1 change the ADK Platform 2 3 click Apply click Apply

The gradle will rebuild The project automatically. gradle will automatically rebuild The project.


# 6 building
According to this answer , you just don't include minsdkversion in the manifest.xml, And the build system will use the values from the build.gradle file and put the information into the final apk. according to this answer, you only need to include minsdkversion in the manifest.xml, the build system will use the values in the build.gradle file and put the information into the final apk.
Because the build system needs this information anyway, this makes sense. Because the build system still needs this information, so this makes sense. You should not need to define this values two times. You do not need to define this values twice.
You just have to sync the project after changing the build.gradle file, But Android Studio 0.5.2 display a yellow status bar on top of the build. Gradle editor window to help you you only need to synchronize the project after changing the build. Gradle file, But Android Studio 0.5.2 displays the yellow status bar at the top of the build.gradle editor window to help you
Also note there at least two build. Gradle files: one master and one for the app/module. Also note that there are at least two build. Gradle files: one main file and one file for the application /module. The one to change is in The app/module, it already includes a property minSdkVersion in a newly generated project. to change is in The app/module, It has already included the attribute minSdkVersion in the newly generated project.

In IOS development, there is an error: Apple mach-o linker error

Small make up in a small demo letter about ring, ring of import letter SDK (EaseMobSDK), the connection of the error, as shown in the figure below:

solution is in general, the following figure, respectively, in the absence of label arrow to add compiler needs. M files and the necessary framework:

and the small make up the problem here is not more than compile files and framework problem, the solution is,

in the third arrow to add: -obJC, and then you just recompile.

Android Studio sync build.gradle appears: Failed to resolve: com.android.support:appcompat problem

After initializing a project using Android Studio, you need to sync the app/build.gradle file, but it will report an error such as:

Failed to resolve: com.android.support:appcompat-v7:26.0.0

What is the reason for this?
If your Android SDK is greater than 26.0.0, you will need to add the following statements in build.Gradle in the root directory of your project:

...

allprojects {
    repositories {
        ...
        maven {
            url "https://maven.google.com"
        }
    }
}

...

Refer to the link
In addition, if it still doesn’t work, let’s see if the SDK version is correct. In app/build.gradle, there is a column of data that is buildToolsVersion, and we should write its SDK version