Android build system command mm fails with this error "The import org.mockito cannot be resolved" - mockito

I am using Android build system command mm to create an apk file for unit testing. I use mockito in the test classes and therefore I imported it in my code:
import static org.mockito.Mockito.*;
mm terminates with this error:
ERROR: : The import org.mockito cannot be
resolved ninja: build stopped: subcommand failed.
Could anyone know what has caused this issue and how it can be solved?

Related

getting error on build in package name.ratson.cordova.admob;

I created new project using ionic capacitor sync android and was trying to sign apk key for the app
After running build I'm getting below error in package name.ratson.cordova.admob; inside capacitor-cordova-android-plugins.
Can someone please guide me on where am I going wrong?
> Task :capacitor-cordova-android-plugins:compileReleaseJavaWithJavac
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AbstractExecutor.java:3: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:5: error: package android.support.annotation does not exist
import android.support.annotation.NonNull;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:8: error: package com.google.ads.mediation.admob does not exist
import com.google.ads.mediation.admob.AdMobAdapter;
^
D:\app\android\capacitor-cordova-android-plugins\src\main\java\name\ratson\cordova\admob\AdMob.java:9: error: package com.google.android.gms.ads does not exist
import com.google.android.gms.ads.AdRequest;
.
.
.
.
D:\app\android\capacitor-cordova-android-plugins\src\main\java\org\apache\cordova\camera\CameraLauncher.java:800: error: cannot find symbol
Uri tmpFile = FileProvider.getUriForFile(cordova.getActivity(),
^
symbol: variable FileProvider
location: class CameraLauncher
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
86 errors
> Task :capacitor-cordova-android-plugins:compileReleaseJavaWithJavac FAILED
Thanks in advance.

pysurvival installs, but throws an exception on import

I am trying to use pysurvival library from an python 3 console application.
I have installed the module per the instructions here.
When I try to import the model,
from pysurvival.models.survival_forest import ConditionalSurvivalForestModel
I get the following error
python3(2454,0x10841adc0) malloc: *** error for object 0x7fff90ea5950: pointer being freed was not allocated
python3(2454,0x10841adc0) malloc: *** set a breakpoint in malloc_error_break to debug
However, just importing the library passes through with no errors.
import pysurvival
My envrionment:
macOS Catalina - 10.15.3
I have both Python2 and Python3 on my machine.

PyQt5 application is not working (just cmd flashing) when built with PyInstaller or py2exe, missing dll's

I've created a script in python that is using PyQt5. Now everything works when I'm launching the file from my editor - Studio Code in this case.
I'm having a problem when I try to deploy an exe using PyInstaller or py2exe it gives me error on missing dll's when it's building. It still finishes building anyway, but when I try to run the exe file the cmd window just flashes for a brief moment and nothing more happens.
I suppose this is due to missing dll's and if not than I have to sort this out first anyway.
I've tried searching for the dll's I'm missing on my computer and some I couldn't find at all e.g. Qt53DInput and one I could find in what I suppose is application made in Qt - Qt5Multimedia .
I'm currently using python 3.7.4 which I've already tried reinstalling. I think I didn't try to reinstall PyQt5, should I try doing that?
from PyQt5 import QtWidgets, uic, QtGui, QtCore, QtQuick
import sys
import os.path
import datetime
import shutil
I guess the only important part of my script in this case are the imports, so I've included them here.
python -m PyInstaller --paths C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin my_code.py
Somewhere I've read that it's good idea to include this path, but since the dll are not to be found anywhere, including this folder, then obviously didn't help at all.
This is the warning about the dll's I'm getting:
Looking for dynamic libraries
32805 WARNING: lib not found: Qt5MultimediaQuick.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtMultimedia\declarative_multimedia.dll
58554 WARNING: lib not found: Qt53DInput.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
58844 WARNING: lib not found: Qt53DAnimation.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
58989 WARNING: lib not found: Qt53DRender.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
59284 WARNING: lib not found: Qt53DLogic.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
59440 WARNING: lib not found: Qt53DCore.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene3D\qtquickscene3dplugin.dll
60365 WARNING: lib not found: Qt53DQuickScene2D.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
60680 WARNING: lib not found: Qt53DRender.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
60992 WARNING: lib not found: Qt53DCore.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\lib\site-packages\PyQt5\Qt\qml\QtQuick\Scene2D\qtquickscene2dplugin.dll
84256 WARNING: lib not found: api-ms-win-core-winrt-l1-1-0.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin\qt5bluetooth.dll
84545 WARNING: lib not found: api-ms-win-core-winrt-string-l1-1-0.dll dependency of C:\Users\bonana\AppData\Local\Programs\Python\Python37-32\Lib\site-packages\PyQt5\Qt\bin\qt5bluetooth.dll
Maybe it's not complete answear to why PyInstaller or py2exe is not working, but I've found way to deploy my exe properly. I've used fman build system. It didn't work right off the bat though. I had to install windows 10 sdk and make small change to my code:
QFileDialog.getOpenFileName(appctxt)
This no longer worked, because for some reason it needed to be changed to:
QtWidgets.QFileDialog.getOpenFileName(appctxt)
Other than that everything including creation of an installer worked without a problem.

How do I make GlideApp Compatible with androidx?

I recently migrated my app from AppCompat to Androidx but now I'm facing a serious issue with GlideApp. Whenever I try building the project, it shows compilation failed.
I tried changing the following import statements,
import android.support.annotation.CheckResult;
import android.support.annotation.NonNull;
in the build folder to:
import androidx.annotation.CheckResult;
import androidx.annotation.NonNull;
But whenever I rebuild it just regenerates the former import statement and returns the following errors:
error: package android.support.annotation does not exist error:
cannot find symbol class NonNull
I found the fix by adding annotationProcessor 'androidx.annotation:annotation:1.1.0' to my dependencies in app build.gradle and was able to build the project with no errors.
Got the solution from here: https://github.com/bumptech/glide/issues/3080#issuecomment-426331231

Android - after import module I'm getting an error on run time

I've imported a module of Image Picker.
On compile time it pass, but on run time it fail on error:
Error:(25, 35) error: package com.giljulio.imagepicker.ui does not exist
Why is that ?
Do I need to add any more information to the question ?

Resources