Tag Archives: grade

NDK Version Clang++: error: unknown argument: ‘-static-openmp‘

Cmakelists.txt file compiles ncnn and CPP and runs normally on the other two Ubuntu machines.

Similarly, the source code is configured, the project is loaded, and the gradle initialization is correct, but there is an error in compiling APK.

clang++: error: unknown argument: ‘-static-openmp’

After searching for a long time, I can’t see the wrong configuration. I doubt the gradle version. The problem remains after the upgrade; Upgrade the as version, and the problem still occurs.

Open settings, SDK configuration, check SDK tools, and reinstall SDK. The latest SDK 23.0 is installed at once. The error disappears, but there is still a problem with the compilation. It is reduced to SDK 20.0, and the error occurs again.

High or low, choose ndk21.3 and cmake3.10.2. Finally, the compilation is normal and the debugging is passed.

[Solved] Android Studio Error: The binary version of its metadata is 1.5.1, expected version is 1.1.15.

Question:

Android studio reports an error: module was compiled with an incompatible version of kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.15.
Solution 1:

Add ext.kotlin in build.gradle of the project_ Version = "1.3.72" (lower version) changed to ext.kotlin_ Version = "1.5.21" (not necessarily 1.5.21, but also the latest version). Just sync and run again

Solution 2:

Open build.gradle under your module (my module name here is MyLibrary) directory, delete some lines in dependencies, and only the corresponding lines in the second figure are left. Just run it again

these lines remain:

Gradle:Using flatDir should be avoided because it doesn‘t support any meta-data formats.

app.gradle

Code snippet 1:

repositories {
    flatDir {
        dirs 'libs'
    }
}

Code snippet 2:

dependencies {
    classpath "com.android.tools.build:gradle:4.2.2"
}

After gradle is upgraded to 4.2.2, the following prompt message will appear during compilation. Delete & lt; Code snippet 1 & gt; The problem can be solved

Using flatDir should be avoided because it doesn’t support any meta-data formats.
Affected Modules: APP

Use the LIBS directory if necessary

        Add the following code to the project module.gradle

android {
    
    ...

    sourceSets {
        main {
            jniLibs.srcDirs = ['libs']
        }
    }
}

Problem solving.

[problem record] installed build tools revision 31.0.0 is broken during Android studio compilation

Error: * * build tool 31.0.0 is missing DX at XXXX (SDK installation address) * * the same error as the title

resolvent

do not use the latest build tools, uninstall the latest packaging tool

Use a different version of build tools instead

Step 1: set up the SDK manager

The setting method is as follows:

    in the top column, select toolsdkmanager, remove the check of Android API 31 and apply SDK platforms as needed, such as Android 11.0 ®, And apply

    The completion result is shown in the figure:

    The second step is to set up the build.gradle file

    1、 Open the build.gradle file in the location shown in the figure
    note: the second build.gradle file opens here. When the mouse is over, module: modulename.app displays

    2、 Modify the contents of the build.gradle file as shown in the figure

    PS: find the SDK version number used by the current simulator

    The current simulator uses the SDK version, which can be viewed by clicking AVD manager in the upper right corner

    or after modifying targetsdkversion, directly click sync and modify it according to the corresponding warning information.

    reference resources:

      [problem record] unity package Android error: & gt; Failed to find build tools revision 30.0.0unity package APK error: failed to find build tools revision 31.0.0 or other versions of Android studio installation, the most detailed in history (more pictures)!! Installation of Android studio (the problem of gradle failure in the supplement is updated on March 10, 2021)

      Thanks to the author of the above article

Android dependency conflict resolution

Conflict resolution
1.exclude

implementation('com.zhy:autolayout:1.4.5') { 

        exclude group: 'com.android.support' 

}

2.buildtoolversion,complie_ sdk_ version,target_ sdk_ Version should exceed the version of V4, V7 and other packages
3. Use the following code block to adjust the version of all support packages

configurations.all { 

        resolutionStrategy.eachDependency { DependencyResolveDetails details -> 

            def requested = details.requested 

            if (requested.group == 'com.android.support') { 

                if (!requested.name.startsWith("multidex")) { 

                    details.useVersion '25.0.0' 

                } 

            } 

}

4. Provided is added when compiling and not when packaging

————————————————
Copyright notice: This is CSDN blogger random_ 7474 “in accordance with the CC 4.0 by-sa copyright agreement. Please attach the link to the original source and this notice
original link: https://blog.csdn.net/random_ 7474/article/details/80703182

Flutter Package error: keyboard_visibility:verifyReleaseResources

··· shell
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ‘:keyboard_visibility:verifyReleaseResources’.

A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
C:\Users\user.gradle\caches\transforms-2\files-2.1\039e4be8150fd2be72df998bdce8645b\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.

 C:\Users\user\.gradle\caches\transforms-2\files-2.1\039e4be8150fd2be72df998bdce8645b\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.

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
BUILD FAILED in 10m 52s
···

Open your project with android studio and change the compileSdkVersion to the same version as yours.

Gradle tasks disappeared after upgrading Android stuido 4.2?

Recently, many people asked that after upgrading Android studio 4.2, tasks could not be seen in the gradle window

Before 4.2
4.2, there were only dependencies and no tasks

The answer is found in the official issue:

https://issuetracker.google.com/issues/185420705

Gradle task list is large and slow to populate in Android projects. This feature by default is disabled for performance reasons. You can re-enable it in: Settings | Experimental | Do not build Gradle task list during Gradle sync.

Gradle tasks is closed by default due to performance problems. You can open it in the following ways:

File -> Settings -> Experimental

Remove the check below

Do not build Gradle task list during Gradle sync

After re engineering sync, you can see gradle tasks.

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?:)

Some processing experiences of failed to notify build listener

When writing a demo, there is a problem as follows:

Failed to notify build listener.

When searching on the Internet, it’s all about the current gradle problem. What is the specific problem?I found one of the Blogs:

https://blog.csdn.net/Evan_ L/article/details/87368075

What I’m saying is that the current gradle version supported by Android studio may not be consistent with the version you expect to use in your project and development tools.

So how do we check?We can carry out the following steps:

1. Check the gradle version you expect to use, and enter gradlew – V in terminal in Android studio. (if you have configured gradle environment, enter gradle – V in CMD) as shown in the figure below:

You can see that my version number here is 5.1.1.

2. Check the gradle version supported by your current Android studio. The location is the gradle folder in your Android studio directory. As shown in the figure:

You can see that I support 4.6 here. So to sum up, my initial judgment is that my expected gradle version is too high. So I need to make my gradle version a little lower to meet the needs of my android studio. How to change it

Here, just change your gradle version to the latest version supported by Android studio. After the change, remember to change the version number of the gradle plug-in, otherwise there will be problems. As shown in the figure:

Remember that the version number of the plug-in here must be changed to correspond to the version number of gradle. The specific corresponding relationship can be viewed on Android’s official website. Here is a link:

https://developer.android.google.cn/studio/releases/gradle-plugin.html#updating-plugin

Then, after the version number is mapped, you may need to change some dependent version numbers. Just follow the prompts. I can only say that’s how my problem was solved. I hope I can help you. Of course, what I said may not be right. I hope Daniel can see it and don’t laugh at us.

If you find that there may be something wrong with my blog, you can check this:

https://blog.csdn.net/qq_ 21397217/article/details/65630730