Tag Archives: grade

[Solved] Project Upgrade Gradle error (Bugly is integrated)

What went wrong: A problem occurred configuring project ‘:app’.
Failed to notify project evaluation listener.
No signature of method: org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultDirectoryVar.getFiles() is applicable for argument types: () values: [] Possible solutions: getAsFile(), getOrElse(java.lang.Object), getOrElse(java.lang.Object), getClass(), getType(), file(java.lang.String) > can’t find tinkerProcessReleaseManifest, you must init tinker plugin first!

Solution:
Go back to the original Gradle setup
Check the build.gradle file in the project

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath "com.tencent.bugly:tinker-support:1.1.5"
    }

Put classpath “classpath ‘com.android.tools.build:gradle:3.5.2’’ is modified to the original version [modified at this time]
bugly is not compatible with the higher version of gradle. Basically, it should be in 3 X version
also, check the gradle folder under the app directory, open the wrapper folder, and find the gradle-wrapper.properties file
changes the distributionurl to the original version.

[Solved] Android Studio Compile Error: Invalid main APK outputs : EarlySyncBuildOutput

Invalid main APK outputs : EarlySyncBuildOutput(type=com.android.build.gradle.internal.scope.InternalArtifactTypeKaTeX parse error: Undefined control sequence: \work at position 65: …on=0, output=F:\ ̲ w ̲ o ̲ r ̲ k ̲\ MobileWMS\app\… APK@1c2249b8 , apkType=MAIN, filtersData=[], version=0, output=F:\work\MobileWMS\app\build\outputs\apk\debug\output-metadata.json)

An error is reported when the version is too low. An error is reported when compiling again
after modifying the gradle version, an error is reported when compiling again, which is caused by the previously compiled APK

Solution:
Click clean project under the build directory to clear the previously compiled data

clear and then compile!

[Solved] Android gradle Error: gradle project sync failed. Please fix your project and try again

Another error was reported during Android development. This is a version error. The first step is to synchronize the versions
error message:
Android studio error: gradle project sync failed. Please fix your project and try again

1. Version synchronization:

1.1 file> sync project with android gradle

If you succeed, you don’t have to look at the following

1.2 error reporting:

It can be seen or not solved:

It should be the version problem. If we can’t download it, we can download it directly manually (check the network first, and the agent has no problem, but it still can’t be solved)

2. Modify proxy parameters:

Agent:

2.1 open file> setting> Search proxy

2.2 configuration information

The address and port of the agent shall be filled in as follows:

URL: http://127.0.0.1:1080/pac

2.3 check whether the Ping is connected

    1. use check connection

      1. enter a website to test: www.baidu.com, and then test: </ OL>

Still not!

3. Manual Download

So let’s continue:

3.1 open the gradle wrapper properties file

3.2 download

Download the gradle in the last line of the website. Note that the version must be consistent. Download whatever he puts down.

3.3 modifying environment variables

Remember to modify the gradle environment variable in the computer:

        1. system environment variable:

          1. path:

3.4 modify the compilation environment configuration

Then unzip it, modify the gradle configuration in the environment, and it’s OK.

You can see that my environment is OK now:

[Solved] Unity package Error: CommandInvokationFailure: Gradle build failed.

CommandInvokationFailure: Gradle build failed.
F:/Program Files/Unity/2017.4.31f/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “F:\Program Files\Unity\2017.4.31f\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.6.0.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

 

Solution:

if there is where in the error message: followed by garbled characters, it means that the path is wrong, and neither the project nor the signature can be in English.

[Solved] UE4 Android Package Error: failed for task :permission_library:compileDebugJavaWithJavac

Record ue4.27 Android packaging failure compileDebugJavaWithJavac

Enter the project folder G: \UE4_Project\MyProject\Intermediate\Android\arm64\gradle

Execute CMD  gradlew compileDebugJavaWithJavac

Solutions:

1. Add the red part to the .Build.cs of the project

2. Create extra file_UPL_.xml

3. Paste the following content into XML

<?xml version="1.0" encoding="utf-8"?>
<!-- XML -->
<root xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Gradle Properties -->
<gradleProperties>
<insert>
ANDROID_BUILD_TOOLS_GRADLE_VERSION=com.android.tools.build:gradle:3.5.3
</insert>
</gradleProperties>
</root>

How to Solve Kotlin unresolved reference error

A crazy problem is that after the project is transferred to kotlin, it always reports: unresolved reference: XXXXXXX
the pre compilation of the project can report no error, but the problem is reported as soon as the mark is marked. The location of the problem is related to the interface defined by kotlin in in the project,
so it begins to solve:
check whether there are bugs in the definition code of the interface. The conclusion is no problem. Check whether there are bugs in the implementation of the interface. The conclusion is that the implementation class has not been executed to the environment, whether there are problems, and the version of gradle and other related tools has not been upgraded. Therefore, create a new kotlin module to import the error interface class, Results it works normally

conclusion:
when defining the interface of kotlin in the module of Java environment, an error will be reported during compilation.

How to Solve Project Upgrade to flutter2.5.0 Error

Record an error report about the error report after the project is upgraded to 2.5.0

error message 1:

Class 'kotlin.Unit' 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:
in your project level gradle file, just increase ext.kotlin.version from any version you have to "1.4.32" or any latest version available. Path:/Android/build. Gradle

buildscript {
    // ext.kotlin_version = '1.3.50'
    ext.kotlin_version = '1.4.32'
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
        // google()
        // mavenCentral()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:4.1.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

allprojects {
    repositories {
        maven { url 'https://maven.aliyun.com/repository/google'}
        maven { url 'https://maven.aliyun.com/repository/jcenter'}
        maven { url 'http://maven.aliyun.com/nexus/content/groups/public'}
        // google()
        // mavenCentral()
    }
}

rootProject.buildDir = '../build'
subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

Error Message 2:
D8: Cannot fit requested classes in a single dex file (# methods: 76688 > 65536) com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives:
The shrinker may have failed to optimize the Java bytecode.
Solution
Path: /android/app/build.gradle,Change the minSdkVersion version to a larger one, e.g. 21

    defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.good_commodity"
        minSdkVersion 21
        targetSdkVersion 30
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
    }

How to Solve Error while executing: am start -n

When Android studio installs and debugs APK, the compilation passes, but when debugging and installing online, it will report an error while executing: am start – N error

The ADB uninstall package name is not used

After searching for a long time, I found that the installation options in edit configuration were set to nothing before. When running, it will not automatically PM install

Change to default APK as follows