Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Development APK File Failed After Enabling PushKit #517

Open
qinhanlei opened this issue Aug 18, 2024 · 6 comments
Open

Build Development APK File Failed After Enabling PushKit #517

qinhanlei opened this issue Aug 18, 2024 · 6 comments
Labels
investigating We are investigating the current problem new waiting for confirmation The solution has been given

Comments

@qinhanlei
Copy link
Contributor

Here are the logs from the console:

CommandInvokationFailure: Gradle build failed. 
/Applications/Unity/Hub/Editor/2022.3.42f1/PlaybackEngines/AndroidPlayer/OpenJDK/bin/java -classpath "/Applications/Unity/Hub/Editor/2022.3.42f1/PlaybackEngines/AndroidPlayer/Tools/gradle/lib/gradle-launcher-7.5.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

Environment Variables:
AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0
DEBUG_ENV_VAR = UnityHub
XPC_FLAGS = 0x0
__CFBundleIdentifier = com.unity3d.unityhub
AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8
AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa
COMMAND_MODE = unix2003
AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
JAVA_HOME = /Applications/Unity/Hub/Editor/2022.3.42f1/PlaybackEngines/AndroidPlayer/OpenJDK
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm
AMPLITUDE_TOKEN_GREENBUCKET_PROD = ZpUcbAdZXJYzNSoHsAWtL_s_JppwWid9
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
XPC_SERVICE_NAME = application.com.unity3d.unityhub.653561654.653562654
ANDROID_NDK_ROOT = /Applications/Unity/Hub/Editor/2022.3.42f1/PlaybackEngines/AndroidPlayer/NDK
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
USER = admin
MallocNanoZone = 0
LOGNAME = admin
__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a
PATH = /usr/bin:/bin:/usr/sbin:/sbin
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.s13YYMrpuq/Listeners
AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46
AMPLITUDE_TOKEN_REDBUCKET_PROD = jTIgKs5KTZOjiqEEVdZFbgo_VRhABduL
AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = UYDQtPOw83dIfVy3SrW5oMyo7ru4PRkV
HOME = /Users/admin
TMPDIR = /var/folders/0f/dk3r4c655glc1r0mhrm7snh40000gn/T/
AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9
AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO
SHELL = /bin/zsh
AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994
AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS
ORIGINAL_XDG_CURRENT_DESKTOP = undefined


stderr[
--E- get manifestOutputDirectory error
get manifestOutputDirectory error: Could not get unknown property 'manifestOutputDirectory' for task ':launcher:processDebugManifest' of type com.android.build.gradle.tasks.ProcessMultiApkApplicationManifest.
Note: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/unityLibrary/src/main/java/com/unity3d/player/UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
ERROR:/Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar: D8: Type org.m0skit0.android.hms.unity.BuildConfig is defined multiple times: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar:classes.dex, /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/494bd20435de94c95162014c47ec58f996abbf56dba109b20dfaca66c378d6c1_2.jar:classes.dex
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Type org.m0skit0.android.hms.unity.BuildConfig is defined multiple times: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar:classes.dex, /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/494bd20435de94c95162014c47ec58f996abbf56dba109b20dfaca66c378d6c1_2.jar:classes.dex
	at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:151)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:138)
	at com.android.build.gradle.internal.tasks.DexMergingWorkAction.merge(DexMergingTask.kt:858)
	at com.android.build.gradle.internal.tasks.DexMergingWorkAction.run(DexMergingTask.kt:804)
	at com.android.build.gradle.internal.profile.ProfileAwareWorkAction.execute(ProfileAwareWorkAction.kt:74)
	at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:63)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:66)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.create(NoIsolationWorkerFactory.java:62)
	at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:100)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.lambda$execute$0(NoIsolationWorkerFactory.java:62)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
	at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
	at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
	at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:59)
	at org.gradle.workers.internal.DefaultWorkerExecutor.lambda$submitWork$2(DefaultWorkerExecutor.java:205)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:187)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.access$700(DefaultConditionalExecutionQueue.java:120)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner$1.run(DefaultConditionalExecutionQueue.java:162)
	at org.gradle.internal.Factories$1.create(Factories.java:31)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:249)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:109)
	at org.gradle.internal.work.DefaultWorkerLeaseService.runAsWorkerThread(DefaultWorkerLeaseService.java:114)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:157)
	at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:126)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete, origin: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar:classes.dex
	at Version.fakeStackEntry(Version_4.0.52.java:0)
	at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:75)
	at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:28)
	at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:27)
	at com.android.tools.r8.internal.vk.b(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:2)
	at com.android.tools.r8.D8.run(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:11)
	at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:136)
	... 38 more
Caused by: com.android.tools.r8.internal.g: Type org.m0skit0.android.hms.unity.BuildConfig is defined multiple times: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar:classes.dex, /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/494bd20435de94c95162014c47ec58f996abbf56dba109b20dfaca66c378d6c1_2.jar:classes.dex
	at com.android.tools.r8.internal.GV.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:14)
	at com.android.tools.r8.internal.GV.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:22)
	at com.android.tools.r8.internal.rP.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:44)
	at com.android.tools.r8.internal.rP.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:10)
	at java.base/java.util.concurrent.ConcurrentHashMap.merge(ConcurrentHashMap.java:2048)
	at com.android.tools.r8.internal.rP.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:6)
	at com.android.tools.r8.graph.F2$a.e(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:7)
	at com.android.tools.r8.dex.b.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:84)
	at com.android.tools.r8.dex.b.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:23)
	at com.android.tools.r8.dex.b.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:22)
	at com.android.tools.r8.D8.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:50)
	at com.android.tools.r8.D8.d(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:19)
	at com.android.tools.r8.D8.b(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:1)
	at com.android.tools.r8.internal.vk.a(R8_4.0.52_5a340ca2823c7e792fe09805c75f749b9d398d230bc0518bb54ae9b6b50addbe:24)
	... 41 more


FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':launcher:mergeProjectDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingTaskDelegate
   > There was a failure while executing work items
      > A failure occurred while executing com.android.build.gradle.internal.tasks.DexMergingWorkAction
         > com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
           Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
           Type org.m0skit0.android.hms.unity.BuildConfig is defined multiple times: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/33321024449ba111fd772990055fa4f39b80633eca72de030e293d9351fd6cad_2.jar:classes.dex, /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/build/intermediates/mixed_scope_dex_archive/debug/out/494bd20435de94c95162014c47ec58f996abbf56dba109b20dfaca66c378d6c1_2.jar:classes.dex

* 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.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
java.lang.StackOverflowError (no error message)

* 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 1m 43s
]
stdout[
Starting a Gradle Daemon, 1 stopped Daemon could not be reused, use --status for details

> Configure project :launcher
WARNING:API 'android.registerTransform' is obsolete.
It will be removed in version 8.0 of the Android Gradle plugin.
The Transform API is removed to improve build performance. Projects that use the
Transform API force the Android Gradle plugin to use a less optimized flow for the
build that can result in large regressions in build times. It’s also difficult to
use the Transform API and combine it with other Gradle features; the replacement
APIs aim to make it easier to extend the build without introducing performance or
correctness issues.

There is no single replacement for the Transform API—there are new, targeted
APIs for each use case. All the replacement APIs are in the
`androidComponents {}` block.

The Transform API uses incremental APIs deprecated since Gradle 7.5. Please add
`android.experimental.legacyTransform.forceNonIncremental=true` to
`gradle.properties` to fix this issue. Note that this will run transforms
non-incrementally and may have a build performance impact.
For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
--W- Build Environment: AGConnect plugin version is: 1.9.1.301, Gradle version is: 7.5.1, Android Plugin version is: 3.5.4
--I- Using the AGConnect-Config file: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/agconnect-services.json
--W- The variant: debug, Use the json file: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/agconnect-services.json
--I- Using the AGConnect-Config file: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/agconnect-services.json
--W- The variant: release, Use the json file: /Users/admin/ProjXXX/Library/Bee/Android/Prj/IL2CPP/Gradle/launcher/agconnect-services.json
WARNING:We recommend using a newer Android Gradle plugin to use compileSdk = 34

This Android Gradle plugin (7.4.2) was tested up to compileSdk = 33

This warning can be suppressed by adding
    android.suppressUnsupportedCompileSdk=34
to this project's gradle.properties

The build will continue, but you are strongly encouraged to update your project to
use a newer Android Gradle Plugin that has been tested with compileSdk = 34
WARNING:The specified Android SDK Build Tools version (28.0.3) is ignored, as it is below the minimum supporte<message truncated>

The build for the release version was successful.

@github-actions github-actions bot added the new label Aug 18, 2024
Copy link

Thank you for reporting this issue/advice.

We will get back to you as soon as possible.
Would you like to star our plugin to support us? ✨

@Aziz-T
Copy link
Collaborator

Aziz-T commented Aug 29, 2024

Hello Developer @qinhanlei

The problem is with multidex builder. Actually, this often happens when you have imported a lot of packages in your yaml file which cannot fit into a single .dex built hence you have to enable multidex.

Go to android/app/build.gradle and add the following lines of code

dependencies {
    implementation 'com.android.support:multidex:2.0.1' //enter the latest multidex version
}

android {
    defaultConfig {
        multiDexEnabled true
    }
}

@qwes348
Copy link

qwes348 commented Sep 24, 2024

Package name org.m0skit0.android.hms.unity is used twice
first one is Assets\Huawei\Plugins\Android\HMSUnityPushKit.plugin\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.m0skit0.android.hms.unity">
    <application>
        <service
            android:name=".push.HMSPushService"
            android:exported="false">
            <intent-filter>
                <action android:name="com.huawei.push.action.MESSAGING_EVENT" />
            </intent-filter>
        </service>
    </application>
</manifest>

second one is Assets\Huawei\Plugins\Android\app-debug.aar\AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="org.m0skit0.android.hms.unity"
    android:versionCode="1"
    android:versionName="1.0" >

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

    <application>
        <receiver
            android:name="org.m0skit0.android.hms.unity.location.LocationBroadcastReceiver"
            android:exported="true" >
            <intent-filter>
                <action android:name="com.huawei.hmssample.location.LocationBroadcastReceiver.ACTION_PROCESS_LOCATION" />
            </intent-filter>
        </receiver>
        <receiver
            android:name="org.m0skit0.android.hms.unity.location.GeofenceBroadcastReceiver"
            android:exported="true" >
            <intent-filter>
                <action android:name="com.huawei.hmssample.geofence.GeoFenceBroadcastReceiver.ACTION_PROCESS_LOCATION" />
            </intent-filter>
        </receiver>

        <activity
            android:name="org.m0skit0.android.hms.unity.activity.SplashActivity"
            android:configChanges="orientation|screenSize"
            android:exported="false"
            android:screenOrientation="fullSensor"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />
        <activity
            android:name="org.m0skit0.android.hms.unity.activity.NativeBridgeActivity"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest>

and guess is that release build seems to succeed because it does not generate a buildconfig
show Assets\Huawei\Plugins\Android\HMSUnityPushKit.plugin\build.gradle

    ...
    afterEvaluate {
        generateReleaseBuildConfig.enabled = false
    }

I don't know how to fix this, but I think this is the cause.

@Aziz-T Aziz-T added the investigating We are investigating the current problem label Oct 18, 2024
@Aziz-T
Copy link
Collaborator

Aziz-T commented Oct 18, 2024

Hi @qinhanlei

We did not encounter such a problem when we tested it on our end. Can you try clearing the caches? You can try the following method:

Manually Cleaning Unity Cache Folders:
Library folder: This folder contains build cache files related to the project. Sometimes it can cause errors, so deleting this folder helps.
Delete the Library folder in your project directory.
Then restart Unity. Unity will recreate this folder and the files within it.

Can you then go to Assets > Reimport All and try again?

@Aziz-T Aziz-T added the waiting for confirmation The solution has been given label Oct 18, 2024
@qinhanlei
Copy link
Contributor Author

Hi @Aziz-T

Sorry for my late reply. I’ve been quite busy with company tasks.

This problem has also recurred in several different projects when I used 2022.3.50f1 recently.

I cleared the caches many times, but it didn’t work.
I ran git clean -fdx after closing the project. We use the gitignore file from https://github.com/github/gitignore.
So, every time I reopen the project, it reimports everything again.

Thank you, @qwes348. That sounds reasonable. Have no idea how to fix the issue either.

@Aziz-T
Copy link
Collaborator

Aziz-T commented Oct 22, 2024

Hi @qinhanlei

I was able to get the problem on my side and the solution should be like this.

You should go to the Assets\Huawei\Plugins\Android\HMSUnityPushKit.plugin\build.gradle directory and put the following code.

afterEvaluate { 
       generateDebugBuildConfig.enabled = false
 }

So the new afterEvaluate script should be like this.

    afterEvaluate {
        generateReleaseBuildConfig.enabled = false
        generateDebugBuildConfig.enabled = false
    }

In this way, we prevent the push kit plugin from creating a second build config. Don't forget to clear the caches after placing this code. I suggest you delete the Library folder. Because if there are still conflicting files in the caches, it prevents the build. It will already occur automatically.

Thank you to @qwes348 for making the above explanation and helping me see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We are investigating the current problem new waiting for confirmation The solution has been given
Projects
None yet
Development

No branches or pull requests

3 participants