Robolectric: class file for org.robolectric.util.ShadowProvider not found - android

I just downloaded the Robolectric samples and tried to build it, but I'm getting an error:
$ git clone https://github.com/robolectric/robolectric-samples.git
(Edited settings.gradle to remove the api-16 and api-19 samples, so I'm only building android-api-21.)
Now when I do gradle test it fails at task ':android-api-21:compileTestDebugJava':
:android-api-21:compileTestDebugJava
/tmp/robolectric-samples/android-api-21/src/test/java/com/example/activity/MainActivityTest.java:14: error: cannot access ShadowProvider
import static org.robolectric.Shadows.shadowOf;
^
class file for org.robolectric.util.ShadowProvider not found
/tmp/robolectric-samples/android-api-21/src/test/java/com/example/activity/MainActivityTest.java:23: error: cannot find symbol
final Menu menu = shadowOf(activity).getOptionsMenu();
^
symbol: method shadowOf(Activity)
location: class MainActivityTest
2 errors
:android-api-21:compileTestDebugJava FAILED
I guess it's possible that it's just a temporary problem with the 3.0-SNAPSHOT build or am I doing something wrong?
Some more info:
OS X Yosemite
I have the latest Android SDK 21 and build tools 21.1.2 installed
I deleted my ~/.m2 and ~/.gradle/caches directories first
ran ./gradlew --refresh-dependencies test

Related

Kotlin native hello world compilation failed on arch linux. UnsatidfiedLinkError: Undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE

I have already compiled this simple example on windows using this https://kotlinlang.org/docs/tutorials/native/using-command-line-compiler.html
Then I tried to set up my arch Linux environment, using this
https://snapcraft.io/install/kotlin-native/arch
while also installing the android sdk from AUR using this,
https://noirscape.github.io/guides/2018/06/14/android-sdk-arch-linux.html
ls gives this - build build.gradle.kts main.kt. README.md settings.gradle.kts src
I am not using gradle for this problem but it is installed
cat main.kt gives this -
fun main() {
println("Hello Kotlin/Native!")
}
when I run kotlinc-native main.kt -o build/hello
I get error: compilation failed: /var/lib/snapd/snap/kotlin-native/13/konan/nativelib/libllvmstubs.so: /snap/core/current/lib/x86_64-linux-gnu/librt.so.1:undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
*source files main.kt
*compiler version info: Konan: 0.9.3 / Kotlin: 1.3.0
*Output Kind PROGRAM
exception: java.lang.unsatisfiedLinkError: /var/lib/snapd/snap/kotlin-native/13/konan/nativelib/libllvmstubs.so: /snap/core/current/lib/x86_64-linux-gnu/librt.so.1 undefined symbol: __clock_nanosleep, version GLIBC_PRIVATE
then there are a lot of at java.base at llvm.llvm and at org.jetbrains.kotlin after that. If those are important I can let me know.
I am a baby kotlin user and a baby Linux user. I believe learning starts from the bottom up so I really want to understand what is happening here instead of just solving it by using gradle or android studios.
I have a feeling that the compiler might not have downloaded all the dependencies on its first run or maybe this has something to do with the symbolic link I made from the first link. please help me understand
ps. I am also sharing a git repo for this project across the two OS's. So maybe this is windows getting in the way but I cant really see how that could be.

Delphi 10 Seattle - Failed Android Project Build

I am running Delphi 10 Seattle with the Mobile Development Tools.
I have reinstalled the Android Tools/SDK's/NDK multiple times to no avail.
I have never managed to get an android project compiled, i always got various errors, but I've seemed to reach a roadblock with this one :-
I get a total of 1461 when building the project, all are very similar, im putting just 3 below, but will post more if needed.
[DCC Error] E2597
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -ldl
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lc
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe: error: cannot find -lm
And the fatal error :-
[DCC Fatal Error] F2588 Linker error code: 1 ($00000001)
The project itself is just a Hello World Application to test if building is working, i've seen similar errors when using 3rd party libraries in the application, but no fix seemed to help.
I have double checked all file paths in the SDK Manager, and have posted the filepaths below :-
Android SDK 24.3.3 32 Bit
SDK:-
SDK Base Path: C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows
ZipAlign Location: C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\build-tools\22.0.1\ZipAlign.exe
Android Location: C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\tools\android.bat
Adb location:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platform-tools\adb.exe
Aapt Location:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\build-tools\25.0.2\aapt.exe
SDK API-Level Location:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-sdk-windows\platforms\android-25
NDK:-
NDK Base Path:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c
arm-linux-androideabi-ld.exe Location:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-ld.exe
arm-linux-androidaebi-strip.exe Location :
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\bin\arm-linux-androideabi-strip.exe
gbdserver Location :
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\prebuilt\android-arm\gdbserver\gdbserver
NDK API Location :
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\platforms\android-19
C++ Builder NDK Library Path:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\platforms\android-19\arch-arm\usr\lib
Delphi NDK Library Path:
C:\Users\Test\Documents\Embarcadero\Studio\17.0\PlatformSDKs\android-ndk-r9c\sources\cxx-stl\gnu-libstdc++\4.8\libs\armeabi-v7a
Java:-
Keytool Location:
C:\Program Files\Java\jdk1.8.0_66\bin\keytool.exe
Jarsigner Location:
C:\Program Files\Java\jdk1.8.0_66\bin\jarsigner.exe
Thanks in Advance.
I'm not entirely sure how this happened.
But to fix it, I went into the SDK Manager and deleted the entire SDK set and let the installer reinstall it, I had done this previously and had made no changes between attempts, so not sure why it worked, but it did anyway.
I hope this helps someone else.

Cannot find src/main/jni from the Android Studio project

In order to use NDK in my application, I included an external tool at Preferences -> Tools -> External Tools.
Here's what I did.
As I right-clicked a class and chose the external javah command to create a c class, it didn't work and left a following message.
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid class name: /src/main/jni
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:129)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:107)
at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:64)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:503)
at com.sun.tools.javah.JavahTask.run(JavahTask.java:329)
at com.sun.tools.javah.Main.main(Main.java:46)
Process finished with exit code 1
I properly created the jni folder under the main directory, and I'm still not clear why I keep getting this message.
Here's my development environment.
OS: OS X El Capitan
Android Studio: 2.2.2
I solved this problem by modifying the Parameters and Working Directory as follows.
Parameters: -classpath $Classpath$ -v -jni $FileClass$
Working Directory: $ProjectFileDir$/app/src/main/jni

Android build succeeding with Xamarin Studio (OSX) but failing with XBuild

Title says it all really. I have a project that builds in Xamarin Studio on OSX but fails when I try and use xbuild to build it from the command line. I'm running
/Library/Frameworks/Mono.framework/Commands/xbuild /t:Build /p:Configuration=Release ../foo/foo.sln
to build the app and I'm getting errors like:
obj/Release/android/src/mono/com/google/android/gms/games/multiplayer/realtime/RoomStatusUpdateListenerImplementor.java(51,97): error : error: package com.google.android.gms.games.multiplayer.realtime does not exist
private native void n_onDisconnectedFromRoom (com.google.android.gms.games.multiplayer.realtime.Room p0);
and
obj/Release/android/src/mono/android/support/v7/internal/widget/ActivityChooserModel_OnChooseActivityListenerImplementor.java(8,58): javacerror : error: package android.support.v7.internal.widget.ActivityChooserModel does not exist
android.support.v7.internal.widget.ActivityChooserModel.OnChooseActivityListener
I'm updated Xamarin to the latest bits (5.10.1)

can't deploy my AppBuilder project on android device

I have to test my hybrid mobile application on my android device,I have selected "USB debugging" in my phone and I have selected the "Unknown sources" option,but when I try to deploy my application in my mobile I get this error:
Building package: [D:\WebMobile\test\backupsProjetWebMobile2\KendoUITabStrip1\obj\Debug\MyProjet.zip]
Project files uploaded to the cloud.
Sending build request for project MyProjet with parameters ProjectTypeGuids={070BCB52-5A75-4F8C-A973-144AF0EAFCC9}
Platform=Android
Configuration=Debug
LiveSyncToken=5uW/86s7080iMfWs0yNn+vJIKWo6n1qh4Lpa8kEnoUNFIaJOOQSDimQ9e0N6ELxXgt2bTOb/Xp6eRqCttuaoxQCzlLku533tlF1hvwrKPpxPeX/CfV/aGFN8Wr6MJl4D.
C:\Users\Client\AppData\Local\Microsoft\VisualStudio\14.0\Extensions\zc3hmmck.xbh\Targets\Build.targets(189,3): error : Server build failed. Server output: Project "MyProjet.tmp.proj" (default targets):
android Build Tooling revision 2015.11.03.5r
Warning: Failed to install 'cordova-plugin-mapbox':Error: Variable(s) missing: ACCESS_TOKEN
at /home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/cordova-lib/cordova-lib/src/plugman/install.js:324:23
at _fulfilled (/home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/q/q.js:787:54)
at self.promiseDispatch.done (/home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/q/q.js:816:30)
at Promise.promise.promiseDispatch (/home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/q/q.js:749:13)
at /home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/q/q.js:557:44
at flush (/home/builder/BpcTooling/Cordova3/node_modules/plugman/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:419:13)
Warning: Variable(s) missing: ACCESS_TOKEN
Warning: /home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:189
Warning: throw Error("exit code: " + code);
^
Warning: Error: exit code: 1
at Error (<anonymous>)
at ChildProcess.<anonymous> (/home/builder/BpcTooling/Cordova3/node_modules/cordova-build-utils/bin/install-plugins-3.js:189:14)
at ChildProcess.emit (events.js:98:17)
at Process.ChildProcess._handle.onexit (child_process.js:810:12)
Error: Build failed during execution
Error: 'Build failed with error code 8'
Done building project "MyProjet.tmp.proj" -- FAILED.
.
Done building project "MyProjet.iceproj" -- FAILED.
Build FAILED.
I work with Telerik-AppBuilder visual Studio 2015 extension(kendo-ui) my android phone is Samsung Galaxy Star Duos GT-S7262 version 4.1.2
any help please and thanks
update:
I have folloewed this link [https://github.com/Telerik-Verified-Plugins/Mapbox] but I get this error:1
C:\Users\Admin>cordova plugin add https://github.com/Telerik-Verified-Plugins/Mapbox --variable ACCESS_TOKEN=my.access.token
Current working directory is not a Cordova-based project.
I have installed the cordova-plugins with npm,but I still get the problem :(
So the question boils down to: how in Visual Studio do you provide Cordova variables to plugins?
(You tried adding the plugin from the c:/users/admin folder which is not your project folder, that's why the Cordova CLI said: "Current working directory is not a Cordova-based project.")
I'm assuming you're using the AppBuilder extension for Visual Studio. If so, please read this doc, especially about how to configure variables:
http://docs.telerik.com/platform/appbuilder/creating-your-project/using-plugins/using-verified-plugins/install-verified-plugins

Categories

Resources