I tried to build APK from unity exported project
and then I encountered error
I need to build it using SDK version 22 (android 5.1)
the main problem is
Execution failed for task ':launcher:processDebugResources'
the detail as below
Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :launcher:preDebugBuild UP-TO-DATE
Task :unityLibrary:preDebugBuild UP-TO-DATE
Task :unityLibrary:compileDebugAidl NO-SOURCE
Task :unityLibrary:packageDebugRenderscript NO-SOURCE
Task :launcher:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
Task :launcher:compileDebugAidl NO-SOURCE
Task :unityLibrary:compileDebugRenderscript NO-SOURCE
Task :launcher:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:generateDebugResValues UP-TO-DATE
Task :launcher:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:generateDebugResources UP-TO-DATE
Task :launcher:checkDebugAarMetadata UP-TO-DATE
Task :launcher:generateDebugResValues UP-TO-DATE
Task :unityLibrary:packageDebugResources UP-TO-DATE
Task :launcher:generateDebugResources UP-TO-DATE
Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
Task :launcher:mergeDebugResources UP-TO-DATE
Task :unityLibrary:processDebugManifest UP-TO-DATE
Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
Task :launcher:extractDeepLinksDebug UP-TO-DATE
Task :launcher:processDebugMainManifest UP-TO-DATE
Task :launcher:processDebugManifest UP-TO-DATE
Task :launcher:processDebugManifestForPackage UP-TO-DATE
Task :unityLibrary:parseDebugLocalResources UP-TO-DATE
Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
Task :launcher:mergeDebugShaders UP-TO-DATE
Task :launcher:compileDebugShaders NO-SOURCE
Task :launcher:generateDebugAssets UP-TO-DATE
Task :unityLibrary:generateDebugRFile UP-TO-DATE
Task :launcher:processDebugJavaRes NO-SOURCE
Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
Task :unityLibrary:compileDebugJavaWithJavac UP-TO-DATE
Task :unityLibrary:bundleLibCompileToJarDebug UP-TO-DATE
Task :unityLibrary:mergeDebugShaders UP-TO-DATE
Task :unityLibrary:compileDebugShaders NO-SOURCE
Task :unityLibrary:generateDebugAssets UP-TO-DATE
Task :unityLibrary:packageDebugAssets UP-TO-DATE
Task :unityLibrary:processDebugJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResDebug NO-SOURCE
Task :unityLibrary:bundleLibRuntimeToJarDebug UP-TO-DATE
Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
Task :unityLibrary:mergeDebugNativeLibs UP-TO-DATE
Task :unityLibrary:stripDebugDebugSymbols UP-TO-DATE
WARNING: NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please use android.ndkVersion or android.ndkPath in build.gradle to specify the NDK to use. https://developer.android.com/r/studio-ui/ndk-dir
NDK was located by using ndk.dir property. This method is deprecated and will be removed in a future release. Please use android.ndkVersion or android.ndkPath in build.gradle to specify the NDK to use. https://developer.android.com/r/studio-ui/ndk-dir
Task :unityLibrary:copyDebugJniLibsProjectOnly UP-TO-DATE
Task :launcher:processDebugResources FAILED
AGPBI: {"kind":"error","text":"Android resource linking failed","sources":[{"file":"/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml","position":{"startLine":36}}],"original":"/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml:37: AAPT: error: attribute android:extractNativeLibs not found.\n ","tool":"AAPT"}
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':launcher:processDebugResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/thedventh/Documents/Builds/[AndroidProj]AlQolam-Mathkids/launcher/build/intermediates/packaged_manifests/debug/AndroidManifest.xml:37: AAPT: error: attribute android:extractNativeLibs 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 1s
31 actionable tasks: 1 executed, 30 up-to-date
Any help or info are appreciated
thanks you
Related
Configure project :launcher
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Task :unityLibrary:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :launcher:preDebugBuild UP-TO-DATE
Task :unityLibrary:preDebugBuild UP-TO-DATE
Task :unityLibrary:compileDebugAidl NO-SOURCE
Task :unityLibrary:packageDebugRenderscript NO-SOURCE
Task :unityLibrary:compileDebugRenderscript NO-SOURCE
Task :unityLibrary:generateDebugResValues
Task :unityLibrary:generateDebugResources
Task :launcher:generateDebugBuildConfig
Task :launcher:compileDebugAidl NO-SOURCE
Task :launcher:compileDebugRenderscript NO-SOURCE
Task :launcher:javaPreCompileDebug UP-TO-DATE
Task :launcher:generateDebugResValues
Task :launcher:generateDebugResources
Task :launcher:createDebugCompatibleScreenManifests
Task :launcher:extractDeepLinksDebug
Task :launcher:mergeDebugShaders
Task :launcher:compileDebugShaders
Task :launcher:generateDebugAssets
Task :launcher:processDebugJavaRes NO-SOURCE
Task :unityLibrary:packageDebugResources
Task :unityLibrary:extractDeepLinksDebug
Task :launcher:checkDebugDuplicateClasses
Task :unityLibrary:generateDebugBuildConfig
Task :unityLibrary:processDebugManifest
Task :unityLibrary:mergeDebugShaders
Task :unityLibrary:javaPreCompileDebug
Task :unityLibrary:compileDebugShaders
Task :unityLibrary:generateDebugAssets
Task :launcher:processDebugManifest
Task :launcher:mergeDebugJniLibFolders
Task :launcher:validateSigningDebug
Task :launcher:mergeDebugResources
Task :unityLibrary:packageDebugAssets
Task :unityLibrary:processDebugJavaRes NO-SOURCE
Task :unityLibrary:bundleLibResDebug
Task :unityLibrary:mergeDebugJniLibFolders
Task :unityLibrary:mergeDebugNativeLibs UP-TO-DATE
Task :unityLibrary:stripDebugDebugSymbols UP-TO-DATE
Task :unityLibrary:copyDebugJniLibsProjectOnly UP-TO-DATE
Task :unityLibrary:compileDebugLibraryResources
Task :unityLibrary:parseDebugLocalResources
Task :unityLibrary:generateDebugRFile
Task :launcher:mergeDebugAssets
Task :unityLibrary:compileDebugJavaWithJavac
Task :unityLibrary:bundleLibCompileToJarDebug UP-TO-DATE
Task :unityLibrary:bundleLibRuntimeToJarDebug UP-TO-DATE
aapt2 W 09-26 01:10:06 39385 552603 LoadedArsc.cpp:657] Unknown chunk type '200'.
Task :launcher:processDebugResources
Task :launcher:compileDebugJavaWithJavac UP-TO-DATE
Task :launcher:compileDebugSources UP-TO-DATE
Task :launcher:mergeDebugJavaResource UP-TO-DATE
Task :launcher:mergeLibDexDebug UP-TO-DATE
Task :launcher:dexBuilderDebug UP-TO-DATE
Task :launcher:mergeProjectDexDebug UP-TO-DATE
Task :launcher:mergeDebugNativeLibs UP-TO-DATE
Task :launcher:stripDebugDebugSymbols FAILED
Task :launcher:desugarDebugFileDependencies
42 actionable tasks: 30 executed, 12 up-to-date
UnityEditor.BuildPipeline:BuildPlayer (UnityEditor.BuildPlayerOptions)
Osmo.Shared.Build.BuildBase:BuildTo (Osmo.GameHelper.Build.OsmoBuildConfigObject) (at Assets/Osmo/osmodules/shared/Editor/Build/BuildBase.cs:304)
Osmo.Container.Build.BuildContainer:StartBuild (Osmo.GameHelper.Build.OsmoBuildConfigObject) (at Assets/Editor/Scripts/BuildContainer.cs:34)
Osmo.Container.Build.BuildContainer:StartBuild (Osmo.GameHelper.Build.OsmoBuildConfigTarget,string,bool,bool) (at Assets/Editor/Scripts/BuildContainer.cs:30)
Osmo.Container.Build.BuildMenu:StartBuildAndroidLenovoDebug () (at Assets/Editor/Scripts/BuildMenu.cs:54)
I am on a MacBook Running Android Studio
Under a React Native Project, the TypeScript tests run fine with jest but when we added JUnit tests under a Native Java Module, while it works individually or by folder as long as they are in androidTest, whenever we run "All Tests" in Android Studio, or when they are run under test we get a false fail. The error is always the same.
Running the same tests under Android Tests works
when in android/app/src/androidTest/.../
gives
Yet running the same tests under Tests fails
when I copy them into android/app/src/test/.../
or leave them in androidTest and run all tests
it always gives
So, all these unit tests live happily in android/app/src/androidTest/.../ and do not like being in android/app/src/test/.../ (when I copy/paste them to the android/app/src/test/.../ path the androidTest passes in the ide, but the test version of the same test doesn't pass) But the bad part is the fail is the same: They fail under "Run 'All Tests'" when in /androidTest and give the same reason as if they are wrongly in /test. i.e. "Run 'All Tests'" and "Run unit tests in ''" both fail for the same reason
this is the error dump I get
Executing tasks: [:app:testDebugUnitTest] in project
/Users/local/some/domain/my-app/android
> Configure project :
Repository BintrayJCenter (https://jcenter.bintray.com/) removed, using https://pkgs.dev.azure.com/somedomain/O-Common/maven/v1
Repository MavenRepo (https://repo.maven.apache.org/maven2/) removed, using https://pkgs.dev.azure.com/somedomain/O-Common/maven/v1
Repository Google (https://dl.google.com/dl/android/maven2/) removed, using https://pkgs.dev.azure.com/somedomain/O-Common/maven/v1
...
> Task :app:generatePackageList
> Task :app:preBuild
> Task :app:preDebugBuild
> Task :react-native-community_art:preBuild UP-TO-DATE
> Task :react-native-community_art:preDebugBuild UP-TO-DATE
> Task :react-native-community_art:compileDebugAidl NO-SOURCE
> Task :react-native-community_masked-view:preBuild UP-TO-DATE
> Task :react-native-community_masked-view:preDebugBuild UP-TO-DATE
> Task :react-native-community_masked-view:compileDebugAidl NO-SOURCE
> Task :react-native-cookies:preBuild UP-TO-DATE
> Task :react-native-cookies:preDebugBuild UP-TO-DATE
> Task :react-native-cookies:compileDebugAidl NO-SOURCE
> Task :react-native-datawedge-intents:preBuild UP-TO-DATE
> Task :react-native-datawedge-intents:preDebugBuild UP-TO-DATE
> Task :react-native-datawedge-intents:compileDebugAidl NO-SOURCE
> Task :react-native-device-info:preBuild UP-TO-DATE
> Task :react-native-device-info:preDebugBuild UP-TO-DATE
> Task :react-native-device-info:compileDebugAidl NO-SOURCE
> Task :react-native-exception-handler:preBuild UP-TO-DATE
> Task :react-native-exception-handler:preDebugBuild UP-TO-DATE
> Task :react-native-exception-handler:compileDebugAidl NO-SOURCE
> Task :react-native-gesture-handler:preBuild UP-TO-DATE
> Task :react-native-gesture-handler:preDebugBuild UP-TO-DATE
> Task :react-native-gesture-handler:compileDebugAidl NO-SOURCE
> Task :react-native-safe-area-context:preBuild UP-TO-DATE
> Task :react-native-safe-area-context:preDebugBuild UP-TO-DATE
> Task :react-native-safe-area-context:compileDebugAidl NO-SOURCE
> Task :react-native-screens:preBuild UP-TO-DATE
> Task :react-native-screens:preDebugBuild UP-TO-DATE
> Task :react-native-screens:compileDebugAidl NO-SOURCE
> Task :react-native-sound:preBuild UP-TO-DATE
> Task :react-native-sound:preDebugBuild UP-TO-DATE
> Task :react-native-sound:compileDebugAidl NO-SOURCE
> Task :react-native-svg:preBuild UP-TO-DATE
> Task :react-native-svg:preDebugBuild UP-TO-DATE
> Task :react-native-svg:compileDebugAidl NO-SOURCE
> Task :react-native-vector-icons:preBuild UP-TO-DATE
> Task :react-native-vector-icons:preDebugBuild UP-TO-DATE
> Task :react-native-vector-icons:compileDebugAidl NO-SOURCE
> Task :react-native-version-number:preBuild UP-TO-DATE
> Task :react-native-version-number:preDebugBuild UP-TO-DATE
> Task :react-native-version-number:compileDebugAidl NO-SOURCE
> Task :app:compileDebugAidl NO-SOURCE
> Task :react-native-community_art:packageDebugRenderscript NO-SOURCE
> Task :react-native-community_masked-view:packageDebugRenderscript NO-SOURCE
> Task :react-native-cookies:packageDebugRenderscript NO-SOURCE
> Task :react-native-datawedge-intents:packageDebugRenderscript NO-SOURCE
> Task :react-native-device-info:packageDebugRenderscript NO-SOURCE
> Task :react-native-exception-handler:packageDebugRenderscript NO-SOURCE
> Task :react-native-gesture-handler:packageDebugRenderscript NO-SOURCE
> Task :react-native-safe-area-context:packageDebugRenderscript NO-SOURCE
> Task :react-native-screens:packageDebugRenderscript NO-SOURCE
> Task :react-native-sound:packageDebugRenderscript NO-SOURCE
> Task :react-native-svg:packageDebugRenderscript NO-SOURCE
> Task :react-native-vector-icons:packageDebugRenderscript NO-SOURCE
> Task :react-native-version-number:packageDebugRenderscript NO-SOURCE
> Task :app:compileDebugRenderscript NO-SOURCE
> Task :app:generateDebugBuildConfig UP-TO-DATE
> Task :app:javaPreCompileDebug UP-TO-DATE
> Task :react-native-community_art:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-community_masked-view:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-cookies:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-datawedge-intents:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-device-info:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-exception-handler:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-gesture-handler:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-safe-area-context:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-screens:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-sound:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-svg:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-vector-icons:writeDebugAarMetadata UP-TO-DATE
> Task :react-native-version-number:writeDebugAarMetadata UP-TO-DATE
> Task :app:checkDebugAarMetadata UP-TO-DATE
> Task :app:bundleDebugJsAndAssets
Execution optimizations have been disabled for task ':app:bundleDebugJsAndAssets' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app'. Reason: Task ':app:bundleDebugJsAndAssets' uses this output of task ':react-native-version-number:writeDebugAarMetadata' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
warn Package lint-staged has been ignored because it contains invalid configuration. Reason: Package subpath './package.json' is not defined by "exports" in /Users/local/some/domain/my-app/node_modules/lint-staged/package.json
warning: the transform cache was reset.
Welcome to Metro!
Fast - Scalable - Integrated
info Writing bundle output to:, /Users/local/some/domain/my-app/android/app/build/generated/assets/react/debug/index.android.bundle
info Writing sourcemap output to:, /Users/local/some/domain/my-app/android/app/build/generated/sourcemaps/react/debug/index.android.bundle.map
info Done writing bundle output
info Done writing sourcemap output
info Copying 36 asset files
info Done copying assets
> Task :app:mergeDebugShaders UP-TO-DATE
> Task :app:compileDebugShaders NO-SOURCE
> Task :app:generateDebugAssets UP-TO-DATE
> Task :react-native-community_art:mergeDebugShaders UP-TO-DATE
> Task :react-native-community_art:compileDebugShaders NO-SOURCE
> Task :react-native-community_art:generateDebugAssets UP-TO-DATE
> Task :react-native-community_art:packageDebugAssets UP-TO-DATE
> Task :react-native-community_masked-view:mergeDebugShaders UP-TO-DATE
> Task :react-native-community_masked-view:compileDebugShaders NO-SOURCE
> Task :react-native-community_masked-view:generateDebugAssets UP-TO-DATE
> Task :react-native-community_masked-view:packageDebugAssets UP-TO-DATE
> Task :react-native-cookies:mergeDebugShaders UP-TO-DATE
> Task :react-native-cookies:compileDebugShaders NO-SOURCE
> Task :react-native-cookies:generateDebugAssets UP-TO-DATE
> Task :react-native-cookies:packageDebugAssets UP-TO-DATE
> Task :react-native-datawedge-intents:mergeDebugShaders UP-TO-DATE
> Task :react-native-datawedge-intents:compileDebugShaders NO-SOURCE
> Task :react-native-datawedge-intents:generateDebugAssets UP-TO-DATE
> Task :react-native-datawedge-intents:packageDebugAssets UP-TO-DATE
> Task :react-native-device-info:mergeDebugShaders UP-TO-DATE
> Task :react-native-device-info:compileDebugShaders NO-SOURCE
> Task :react-native-device-info:generateDebugAssets UP-TO-DATE
> Task :react-native-device-info:packageDebugAssets UP-TO-DATE
> Task :react-native-exception-handler:mergeDebugShaders UP-TO-DATE
> Task :react-native-exception-handler:compileDebugShaders NO-SOURCE
> Task :react-native-exception-handler:generateDebugAssets UP-TO-DATE
> Task :react-native-exception-handler:packageDebugAssets UP-TO-DATE
> Task :react-native-gesture-handler:mergeDebugShaders UP-TO-DATE
> Task :react-native-gesture-handler:compileDebugShaders NO-SOURCE
> Task :react-native-gesture-handler:generateDebugAssets UP-TO-DATE
> Task :react-native-gesture-handler:packageDebugAssets UP-TO-DATE
> Task :react-native-safe-area-context:mergeDebugShaders UP-TO-DATE
> Task :react-native-safe-area-context:compileDebugShaders NO-SOURCE
> Task :react-native-safe-area-context:generateDebugAssets UP-TO-DATE
> Task :react-native-safe-area-context:packageDebugAssets UP-TO-DATE
> Task :react-native-screens:mergeDebugShaders UP-TO-DATE
> Task :react-native-screens:compileDebugShaders NO-SOURCE
> Task :react-native-screens:generateDebugAssets UP-TO-DATE
> Task :react-native-screens:packageDebugAssets UP-TO-DATE
> Task :react-native-sound:mergeDebugShaders UP-TO-DATE
> Task :react-native-sound:compileDebugShaders NO-SOURCE
> Task :react-native-sound:generateDebugAssets UP-TO-DATE
> Task :react-native-sound:packageDebugAssets UP-TO-DATE
> Task :react-native-svg:mergeDebugShaders UP-TO-DATE
> Task :react-native-svg:compileDebugShaders NO-SOURCE
> Task :react-native-svg:generateDebugAssets UP-TO-DATE
> Task :react-native-svg:packageDebugAssets UP-TO-DATE
> Task :react-native-vector-icons:mergeDebugShaders UP-TO-DATE
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app/android/app/build/intermediates/navigation_json/debug/navigation.json'. Reason: Task ':app:processDebugMainManifest' uses this output of task ':app:copyDebugBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app/android/app/build/intermediates/navigation_json/debug/navigation.json'. Reason: Task ':app:processDebugMainManifest' uses this output of task ':app:copyDebugReactNativeVectorIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
/Users/local/some/domain/my-app/android/app/src/debug/AndroidManifest.xml:7:5-12:19 Warning:
application#android:allowBackup was tagged at AndroidManifest.xml:7 to replace other declarations but no other declaration present
> Task :app:processDebugManifest
Execution optimizations have been disabled for task ':app:processDebugManifest' to ensure correctness due to the following reasons:
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app/android/app/build/intermediates/compatible_screen_manifest/debug'. Reason: Task ':app:processDebugManifest' uses this output of task ':app:copyDebugBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app/android/app/build/intermediates/compatible_screen_manifest/debug'. Reason: Task ':app:processDebugManifest' uses this output of task ':app:copyDebugReactNativeVectorIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
- Gradle detected a problem with the following location: '/Users/local/some/domain/my-app/android/app/build/intermediates/merged_manifest/debug/AndroidManifest.xml'. Reason: Task ':app:processDebugManifest' uses this output of task ':app:copyDebugBundledJs' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.2/userguide/validation_problems.html#implicit_dependency for more details about this problem.
> Task :react-native-svg:processDebugJavaRes NO-SOURCE
> Task :react-native-svg:bundleLibResDebug NO-SOURCE
> Task :react-native-svg:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :react-native-vector-icons:processDebugJavaRes NO-SOURCE
> Task :react-native-vector-icons:bundleLibResDebug NO-SOURCE
> Task :react-native-vector-icons:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :react-native-version-number:processDebugJavaRes NO-SOURCE
> Task :react-native-version-number:bundleLibResDebug NO-SOURCE
> Task :react-native-version-number:bundleLibRuntimeToJarDebug UP-TO-DATE
> Task :app:processDebugResources
> Task :app:compileDebugJavaWithJavac UP-TO-DATE
> Task :app:bundleDebugClasses UP-TO-DATE
> Task :app:compileDebugUnitTestJavaWithJavac UP-TO-DATE
> Task :app:packageDebugUnitTestForUnitTest UP-TO-DATE
> Task :app:generateDebugUnitTestConfig UP-TO-DATE
> Task :app:testDebugUnitTest
Called loadFromPath(/system/framework/framework-res.apk, true); mode=binary sdk=28
java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at com.facebook.soloader.ApplicationSoSource.<init>(ApplicationSoSource.java:46)
at com.facebook.soloader.SoLoader.initSoSources(SoLoader.java:285)
at com.facebook.soloader.SoLoader.init(SoLoader.java:207)
at com.facebook.soloader.SoLoader.init(SoLoader.java:189)
at com.facebook.soloader.SoLoader.init(SoLoader.java:217)
at uk.some.domain.myapp.MainApplication.onCreate(MainApplication.java:78)
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:288)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:75)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:288)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:171)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:319)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:254)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)
java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at com.facebook.soloader.ApplicationSoSource.<init>(ApplicationSoSource.java:46)
at com.facebook.soloader.SoLoader.initSoSources(SoLoader.java:285)
at com.facebook.soloader.SoLoader.init(SoLoader.java:207)
at com.facebook.soloader.SoLoader.init(SoLoader.java:189)
at com.facebook.soloader.SoLoader.init(SoLoader.java:217)
at uk.some.domain.myapp.MainApplication.onCreate(MainApplication.java:78)
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:288)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:75)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:288)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:171)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:319)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:254)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)
java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at com.facebook.soloader.ApplicationSoSource.<init>(ApplicationSoSource.java:46)
at com.facebook.soloader.SoLoader.initSoSources(SoLoader.java:285)
at com.facebook.soloader.SoLoader.init(SoLoader.java:207)
at com.facebook.soloader.SoLoader.init(SoLoader.java:189)
at com.facebook.soloader.SoLoader.init(SoLoader.java:217)
at uk.some.domain.myapp.MainApplication.onCreate(MainApplication.java:78)
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:288)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:75)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:288)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:171)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:319)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:254)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)
java.lang.NullPointerException
at java.base/java.io.File.<init>(File.java:278)
at com.facebook.soloader.ApplicationSoSource.<init>(ApplicationSoSource.java:46)
at com.facebook.soloader.SoLoader.initSoSources(SoLoader.java:285)
at com.facebook.soloader.SoLoader.init(SoLoader.java:207)
at com.facebook.soloader.SoLoader.init(SoLoader.java:189)
at com.facebook.soloader.SoLoader.init(SoLoader.java:217)
at uk.some.domain.myapp.MainApplication.onCreate(MainApplication.java:78)
at org.robolectric.android.internal.AndroidTestEnvironment.lambda$installAndCreateApplication$0(AndroidTestEnvironment.java:288)
at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:75)
at org.robolectric.android.internal.AndroidTestEnvironment.installAndCreateApplication(AndroidTestEnvironment.java:288)
at org.robolectric.android.internal.AndroidTestEnvironment.setUpApplicationState(AndroidTestEnvironment.java:171)
at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:319)
at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:254)
at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:89)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
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)
uk.some.domain.myapp.HubTest > testSendEvent_Object FAILED
java.lang.NullPointerException at File.java:278
uk.some.domain.myapp.HubTest > testSendEvent_String FAILED
java.lang.NullPointerException at File.java:278
uk.some.domain.myapp.HubTest > testBridgeHelloWorld FAILED
java.lang.NullPointerException at File.java:278
uk.some.domain.myapp.HubTest > testResetScreenTimer FAILED
java.lang.NullPointerException at File.java:278
4 tests completed, 4 failed
> Task :app:testDebugUnitTest FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:testDebugUnitTest'.
> There were failing tests. See the report at: file:///Users/local/some/domain/my-app/android/app/build/reports/tests/testDebugUnitTest/index.html
* 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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
Execution optimizations have been disabled for 4 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
BUILD FAILED in 44s
220 actionable tasks: 7 executed, 213 up-to-date
13:20:03: Task execution finished ':app:testDebugUnitTest --tests "uk.some.domain.myapp.*"'.
For CI reasons it needs to run under "All Tasks" it appears to be emulator related, can anyone shed light on the cause?
I think this is related to Unit VS Instrumentation tests.
Unit is made for single method / small part of code testing on the local machine (Test folder).
Instrumentation tests on the other hand are made for a more complex testing of features, directly on an emulator (AndroidTest folder).
Possible Solution :
First, I would check every test and ensure they have to run on machine or in emulator, and set them in the proper directory.
Then, you 'll have to run an emulator in your CI to make all your instrumentation tests run properly.
Check testing fundamentals for more informations
I was trying to build my Dagger2 based Android project in Android studio Arctic fox 2020.3.1 with Mac M1 and I got the error,
error: cannot find symbol
import xxxx.com.xxxx.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
which also was showing
Cause: java.lang.ExceptionInInitializerError
The same project was working in another machine(not mac).
Also I am unable to see the compiler error toggle button in android studio build output.
Please help me to resolve this.
complete build output,
Executing tasks: [:app:assembleDebug] in project /projects/Android/prototype
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsDebug UP-TO-DATE
Task :app:dataBindingMergeGenClassesDebug UP-TO-DATE
Task :app:generateDebugResValues UP-TO-DATE
Task :app:generateDebugResources UP-TO-DATE
Task :app:injectCrashlyticsMappingFileIdDebug UP-TO-DATE
Task :app:processDebugGoogleServices UP-TO-DATE
Task :app:mergeDebugResources UP-TO-DATE
Task :app:dataBindingGenBaseClassesDebug UP-TO-DATE
Task :app:dataBindingTriggerDebug UP-TO-DATE
Task :app:generateDebugBuildConfig UP-TO-DATE
Task :app:javaPreCompileDebug UP-TO-DATE
Task :app:checkDebugAarMetadata UP-TO-DATE
Task :app:createDebugCompatibleScreenManifests UP-TO-DATE
Task :app:extractDeepLinksDebug UP-TO-DATE
Task :app:processDebugMainManifest UP-TO-DATE
Task :app:processDebugManifest UP-TO-DATE
Task :app:processDebugManifestForPackage UP-TO-DATE
Task :app:processDebugResources UP-TO-DATE
Task :app:compileDebugJavaWithJavac FAILED
The following annotation processors are not incremental: dagger-android-processor-2.16.jar (com.google.dagger:dagger-android-processor:2.16), dagger-compiler-2.16.jar (com.google.dagger:dagger-compiler:2.16).
Make sure all annotation processors are incremental to improve your build speed.
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/provision/PairingActivity.java:22: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/provision/ProvisionActivity.java:41: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/splash/SplashActivity.java:20: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/appliance/AddApplianceActivity.java:15: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/appliance/event/AddEventActivity.java:8: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
/Users/sysadmin/Documents/projects/esp32/energy-monitor/Android/prototype/app/src/main/java/prototype/com/myapp/ui/welcome/WelcomeActivity.java:10: error: cannot find symbol
import prototype.com.myapp.di.DaggerAppComponent;
^
symbol: class DaggerAppComponent
location: package prototype.com.myapp.di
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
6 errors
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:mergeDebugShaders UP-TO-DATE
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets UP-TO-DATE
Task :app:compressDebugAssets UP-TO-DATE
Task :app:processDebugJavaRes NO-SOURCE
Task :app:checkDebugDuplicateClasses UP-TO-DATE
Task :app:desugarDebugFileDependencies UP-TO-DATE
Task :app:mergeExtDexDebug UP-TO-DATE
Task :app:mergeLibDexDebug UP-TO-DATE
Task :app:mergeDebugJniLibFolders UP-TO-DATE
Task :app:mergeDebugNativeLibs NO-SOURCE
Task :app:stripDebugDebugSymbols NO-SOURCE
Task :app:validateSigningDebug UP-TO-DATE
Task :app:writeDebugAppMetadata UP-TO-DATE
Task :app:writeDebugSigningConfigVersions UP-TO-DATE
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
java.lang.ExceptionInInitializerError
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
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0.2/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 1s
29 actionable tasks: 1 executed, 28 up-to-date
I'd love to comment but I have not enough reputation, anyway, are you using room in your project? I had the same issue also only on my Mac M1, it was caused by the room version, I updated it to 2.4.0-alpha03 and it builds fine since then. if not, you may want to check the version of the libraries you are using, but yeah only on Mac M1, hope it helps.
Executing tasks: [clean, :app:assembleDebug] in project C:\AppiumProject
Task :clean UP-TO-DATE
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:dataBindingMergeDependencyArtifactsDebug
Task :app:dataBindingMergeGenClassesDebug
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:generateDebugBuildConfig
Task :app:javaPreCompileDebug
Task :app:checkDebugAarMetadata
Task :app:createDebugCompatibleScreenManifests
Task :app:extractDeepLinksDebug
Task :app:processDebugMainManifest
Task :app:processDebugManifest
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:mergeDebugResources
Task :app:mergeDebugShaders
Task :app:dataBindingGenBaseClassesDebug
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets
Task :app:compressDebugAssets
Task :app:processDebugJavaRes NO-SOURCE
Task :app:checkDebugDuplicateClasses
Task :app:mergeLibDexDebug
Task :app:mergeDebugJniLibFolders
Task :app:processDebugManifestForPackage
Task :app:mergeDebugJavaResource FAILED
Task :app:desugarDebugFileDependencies
Task :app:mergeDebugNativeLibs
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:mergeDebugJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'META-INF/DEPENDENCIES' from inputs:
- C:\AppiumProject\app\libs\httpclient-4.5.5.jar
- C:\AppiumProject\app\libs\httpcore-4.4.9.jar
Adding a packagingOptions block may help, please refer to
https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html
for more information
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 3s
24 actionable tasks: 23 executed, 1 up-to-date
Can someone please tell my why this does nothing? I've messed with it for two days. The text is never printed, copyAAR is never run. Should be so simple but obviously I'm missing something. This is a project with a main "app" and one module called "MY_Library". This code is in the build.gradle file for My_Library. THANKS!
task copyAAR(dependsOn:'assembleDebug') << {
println "++++++ AAR COPIED ++++++: "
}
Also tried:
afterEvaluate {
copyAAR.dependsOn ':MY_Library:assembleDebug'
}
task copyAAR() << {
println "++++++ AAR COPIED ++++++: "
}
Executing tasks: [:MY_Library:assembleDebug]
Parallel execution with configuration on demand is an incubating feature.
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
at build_bxaa81mwx93hvs7njvdit9vtz$_run_closure1.doCall(C:\zzz\zzz\zzz\zzz\MY_Library\build.gradle:19)
(Run with --stacktrace to get the full stack trace of this deprecation warning.)
:MY_Library:preBuild UP-TO-DATE
:MY_Library:preDebugBuild UP-TO-DATE
:MY_Library:compileDebugAidl UP-TO-DATE
:MY_Library:compileDebugRenderscript UP-TO-DATE
:MY_Library:checkDebugManifest UP-TO-DATE
:MY_Library:generateDebugBuildConfig UP-TO-DATE
:MY_Library:generateDebugResValues UP-TO-DATE
:MY_Library:generateDebugResources UP-TO-DATE
:MY_Library:packageDebugResources UP-TO-DATE
:MY_Library:platformAttrExtractor UP-TO-DATE
:MY_Library:processDebugManifest UP-TO-DATE
:MY_Library:generateDebugRFile UP-TO-DATE
:MY_Library:prepareLintJar UP-TO-DATE
:MY_Library:generateDebugSources UP-TO-DATE
:MY_Library:javaPreCompileDebug UP-TO-DATE
:MY_Library:compileDebugJavaWithJavac UP-TO-DATE
:MY_Library:extractDebugAnnotations UP-TO-DATE
:MY_Library:mergeDebugConsumerProguardFiles UP-TO-DATE
:MY_Library:mergeDebugShaders UP-TO-DATE
:MY_Library:compileDebugShaders UP-TO-DATE
:MY_Library:generateDebugAssets UP-TO-DATE
:MY_Library:packageDebugAssets UP-TO-DATE
:MY_Library:packageDebugRenderscript NO-SOURCE
:MY_Library:processDebugJavaRes NO-SOURCE
:MY_Library:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:MY_Library:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:MY_Library:compileDebugNdk NO-SOURCE
:MY_Library:mergeDebugJniLibFolders UP-TO-DATE
:MY_Library:transformNativeLibsWithMergeJniLibsForDebug UP-TO-DATE
:MY_Library:transformNativeLibsWithSyncJniLibsForDebug UP-TO-DATE
:MY_Library:bundleDebug UP-TO-DATE
:MY_Library:compileDebugSources UP-TO-DATE
:MY_Library:assembleDebug UP-TO-DATE
BUILD SUCCESSFUL in 0s
23 actionable tasks: 23 up-to-date
Well, the only way I got it to work was:
afterEvaluate {
assembleDebug.finalizedBy(copyAAR)
}
Why did the other way not work?!?!?