calabash-android run app-debug.apk throws exception - testing

I am trying to run calabash-android to test my app, but I get the following error, the same app without any modification was working before I tried to do some modifications, but then I reverted all the modifications to the app :
Exception occurred while dumping:
java.lang.IllegalArgumentException: Unknown package: com.bitbar.testdroid
at com.android.server.pm.Settings.isOrphaned(Settings.java:4134)
at com.android.server.pm.PackageManagerService.isOrphaned(PackageManagerService.java:18091)
at com.android.server.pm.PackageManagerService.deletePackage(PackageManagerService.java:15508)
at com.android.server.pm.PackageInstallerService.uninstall(PackageInstallerService.java:888)
at com.android.server.pm.PackageManagerShellCommand.runUninstall(PackageManagerShellCommand.java:792)
at com.android.server.pm.PackageManagerShellCommand.onCommand(PackageManagerShellCommand.java:118)
at android.os.ShellCommand.exec(ShellCommand.java:94)
at com.android.server.pm.PackageManagerService.onShellCommand(PackageManagerService.java:18349)
at android.os.Binder.shellCommand(Binder.java:468)
at android.os.Binder.onTransact(Binder.java:367)
at android.content.pm.IPackageManager$Stub.onTransact(IPackageManager.java:2387)
at com.android.server.pm.PackageManagerService.onTransact(PackageManagerService.java:3031)
at android.os.Binder.execTransact(Binder.java:565)
And then
Success
Success
Scenario: I can choose a file from the Gallery # features/my_first.feature:3
HTTPClient::KeepAliveDisconnected: Connection reset by peer # io_fillbuf - fd:8 (HTTPClient::KeepAliveDisconnected)
./features/support/app_life_cycle_hooks.rb:5:in `Before'
When I take a screenshot # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
Then I take a screenshot # calabash-android-0.9.0/lib/calabash-android/steps/screenshot_steps.rb:9
Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: I can choose a file from the Gallery
1 scenario (1 failed)
2 steps (2 skipped)
0m6.240s
Exception ScreenShot

I solved the problem by running the build using the gradle task :app:assembleDebug
in the exception above, calabash can't find the package name, because it is on another dex class.
I think in calabash, they may be having problem with multidex projects, and Android Studio will always enable multidex to your app, even if it doesn't need it.
I am not an expert, any suggestion are welcome, and I hope some people can benefit from this answer.

Related

Detox build failed - ':react-native-inappbrowser-reborn:mergeDebugAndroidTestJavaResource'

I have a problem with building tests in detox. It shows me this error:
What went wrong:
Execution failed for task ':react-native-inappbrowser-reborn:mergeDebugAndroidTestJavaResource'.
A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
2 files found with path 'META-INF/kotlin-stdlib-jdk8.kotlin_module' from inputs:
- /home/sp/.gradle/caches/transforms-3/4f539c328e5bb19593050e3384e51919/transformed/jetified-kotlin-stdlib-jdk8-1.4.10.jar
- /home/sp/.gradle/caches/transforms-3/c1d521098bb09d070895b1fa3c6468bd/transformed/jetified-kotlin-stdlib-1.8.0.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
I've tried almost everything I found on the forums:
kotlin.stdlib.jdk.variants.version.alignment=false
exclude("META-INF/kotlin-stdlib-common.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk7.kotlin_module")
exclude("META-INF/kotlin-stdlib-jdk8.kotlin_module")
exclude("META-INF/kotlin-stdlib.kotlin_module")
exclude("kotlin/annotation/annotation.kotlin_builtins")
exclude("kotlin/collections/collections.kotlin_builtins")
exclude("kotlin/coroutines/coroutines.kotlin_builtins")
exclude("kotlin/internal/internal.kotlin_builtins")
exclude("kotlin/kotlin.kotlin_builtins")
exclude("kotlin/ranges/ranges.kotlin_builtins")
exclude("kotlin/reflect/reflect.kotlin_builtins")
etc...
I got this error after adding: implementation(platform("org.jetbrains.kotlin:kotlin-bom:1.8.0")) - > in app/build.gradle
I had to add this line because the whole application was not building. After adding this line, the problem discussed above started to appear in detox
Thank you very much for your help

Where to enable zip64 extension in build.gradle.kts?

I am working on a ktor multiplatform application.
While the application is running continuously, I come across an error message that says
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':jvmJar'.
archive's size exceeds the limit of 4GByte.
To build this archive, please enable the zip64 extension.
See: https://docs.gradle.org/7.3.3/dsl/org.gradle.api.tasks.bundling.Zip.html#org.gradle.api.tasks.bundling.Zip:
How and where to enable the zip64 extension?The version of gradle that I am using is 7.3.3
Do you have a Jar task?
Say you use ShadowJar, then the configuration would look like:
tasks.shadowJar {
setProperty("zip64", true)
// other shadow jar config
}

Adding multidex support to Flutter

I am building my app with Flutter. Now I am always getting this error:
FAILURE: Build failed with an exception.* What went wrong:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug',> com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: ...The number of method references in a .dex file cannot exceed 64K.Learn how to resolve this issue: https://developer.android.com/tools/building/multidex.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 BUILD FAILED in 32s Finished with error: Gradle build failed: 1
So this error clearly says that I must add multidex-support. But how to do this in FLUTTER?
The problem is not with Firebase or Firestore - Its the number of dependencies you have added to your application, you need to enable Multidex - there are some steps on how to do it online Flutter multidex problem With FirebaseAuth , Firestore and Google Sign in
Versions of the platform prior to Android 5.0 use the Dalvik runtime for executing app code. By default, Dalvik limits apps to a single classes.dex bytecode file per APK. In order to get around this limitation, you can add the multidex support library to your project:
dependencies {
def multidex_version = "2.0.1"
implementation 'androidx.multidex:multidex:$multidex_version'
}
To view the current versions for this library, see the information about Multidex on the versions page.
If you aren't using AndroidX, add the following support library dependency instead:
dependencies {implementation 'com.android.support:multidex:1.0.3'}
Finally, I fixed it with removing the CloudFirestore implementation. Seems there is a version bug at the time.

An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2)

I'm getting such error, while building IOS app in React Native project:
was encountered processing the command (domain=NSPOSIXErrorDomain,
code=2) Print: Entry, ":CFBundleIdentifier", Does Not Exist
I read threads in GitHub regarding that issues, however didn't find solutions there which could solve my problem. Any ideas how to fix it?
The cause might be that you have some build files from the previous build which are causing the problem.
Clear the ios/build/your_project to trigger a fresh build
In my case the Xcode build folder needed to be cleaned. To fix, in Xcode go to Product | Clean Build Folder
In my case, the cause was - The build file name was MyMob.app but the app it tries to install to the simulator was mymob.app.
I solved it by changing the line in mymob.xcscheme:46
BuildableName = "MyMob.app"
BuildableName = "mymob.app"
Log was
iinfo Installing "build/mymob/Build/Products/Debug-iphonesimulator/mymob.app"
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
info Launching "com.mymob.app"
error Failed to launch the app on simulator, An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=4):
The request to open "com.mymob.app" failed.
Underlying error (domain=FBSOpenApplicationErrorDomain, code=4):
The operation couldn't be completed. Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"
Application info provider (FBSApplicationLibrary) returned nil for "com.mymob.app"

Could not copy the file "resources.dll" because it was not found

I'm getting this error after clicked for the first time in TEST-> Debug -> All Tests
I've been looking and seen something to add Pre build events but it didn't worked out, the error code:
Error 1 Could not copy the file "obj\Debug\qps-ploc\Bigbuilder.resources.dll" because it was not found. Bigbuilder
The program doesn't debug at the first try but when it asks "there was build errors. Would you like to run the last successfull build?" if i click no and retry to execute it will say nothing but the error will mantain in the error list
Uninstall the Multilingual App Toolkit from Programs and Features, download the latest version, and re-install. This fixes the build issues.
Encountered the same problem with building a console application using the Multilingual App Toolkit in a Portable Class Library, and now it is working.