utzcoz

utzcoz

Software Engineer. Free time for @robolectric @boringdroid @maruos.

Member Since 3 years ago

Beijing, China

Experience Points
45
follower
Lessons Completed
136
follow
Lessons Completed
896
stars
Best Reply Awards
27
repos

873 contributions in the last year

Pinned
⚡ Android Unit Testing Framework
⚡ Your phone is your PC.
⚡ boringdroid is an AOSP extending project based on AOSP(9.0 - 11.0), and it provides the patch set to use multi-window in AOSP default.
⚡ Personal blog powered by Jekyll(https://utzcoz.github.io/).
Activity
Jan
21
3 days ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Snapshots are not released

Hi, looking at the snapshots repository https://oss.sonatype.org/content/repositories/snapshots/org/robolectric/robolectric/ looks like last released snapshot was on November 5.

Did you stop releasing snapshots or something is broken? I came here because I tried to use 4.8-SNAPSHOT as stated here https://github.com/robolectric/robolectric/blob/master/README.md?plain=1#L64 but the artifacts are not uploaded

utzcoz
utzcoz

@carlonzo you can show your need for SNAPSHOT at https://github.com/robolectric/robolectric/issues/6803, and I will close this issue. Feel free to reopen it if you have any problem.

Activity icon
issue

utzcoz issue robolectric/robolectric

utzcoz
utzcoz

Cannot open SQLite connection, base error code: 14 - Works first time, but fails all subsequent times

I was running my unit tests with Robolectric 2.4 and got my tests working from referring to the https://github.com/robolectric/robolectric/issues/569 issue and incorporated what @hvu did and closed my db connection and helper connection. This helped all my DB related unit tests pass and not fail for the reasons mentioned in https://github.com/robolectric/robolectric/issues/569.

However, because I am looking to use some Shadows in 3.0 SNAPSHOT, I decided to use Robolectric 3.0 and play services shadows with multi dexing (https://github.com/robolectric/robolectric/issues/1399#issuecomment-79119297). However, after a lot of battling, I realized that only adding Robolectric 3.0-SNAPSHOT would cause the same problem mentioned in #569 . The following is my stack trace

android.database.sqlite.SQLiteException: Cannot open SQLite connection, base error code: 14
    at org.robolectric.shadows.ShadowSQLiteConnection.rethrow(ShadowSQLiteConnection.java:53)
    at org.robolectric.shadows.ShadowSQLiteConnection.access$600(ShadowSQLiteConnection.java:30)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections.execute(ShadowSQLiteConnection.java:443)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections.open(ShadowSQLiteConnection.java:345)
    at org.robolectric.shadows.ShadowSQLiteConnection.nativeOpen(ShadowSQLiteConnection.java:58)
    at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
    at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
    at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:863)
    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:235)
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
    at com.core.database.AndroidDatabaseWrapper.open(AndroidDatabaseWrapper.java:31)
        ...
Caused by: com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
    at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1353)
    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:258)
    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:269)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$1.call(ShadowSQLiteConnection.java:352)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$1.call(ShadowSQLiteConnection.java:345)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$6.call(ShadowSQLiteConnection.java:429)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$6.call(ShadowSQLiteConnection.java:423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    ... 3 more

Here is my gradle settings

buildscript {
    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+'
    }
}

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

...

dependencies {
   ...
    // unit testing
    androidTestCompile fileTree(dir: 'libs/test', include: '*.jar')
    androidTestCompile('com.squareup:fest-android:1.0.+') {
        exclude group: 'com.android.support'
    }
    androidTestCompile 'com.google.dexmaker:dexmaker:1.+'

    androidTestCompile('junit:junit:4.11') {
        exclude module: 'hamcrest-core'
    }
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'org.mockito:mockito-core:1.9.5'
    androidTestCompile 'org.robolectric:android-all:+'
    androidTestCompile('org.robolectric:robolectric:3.0-SNAPSHOT') {
        exclude module: 'classworlds'
        exclude module: 'commons-logging'
        exclude module: 'httpclient'
        exclude module: 'maven-artifact'
        exclude module: 'maven-artifact-manager'
        exclude module: 'maven-error-diagnostics'
        exclude module: 'maven-model'
        exclude module: 'maven-project'
        exclude module: 'maven-settings'
        exclude module: 'plexus-container-default'
        exclude module: 'plexus-interpolation'
        exclude module: 'plexus-utils'
        exclude module: 'wagon-file'
        exclude module: 'wagon-http-lightweight'
        exclude module: 'wagon-provider-api'
    }

}

But when I were to change my dependency of robolectric to just 2.4, then my tests run perfectly fine. Just for reference my Android Database Wrapper has the following snippets

public class AndroidDatabaseWrapper implements IDatabaseWrapper {
    private SQLiteDatabase mDb;
    private SQLiteOpenHelper mDBOpenHelper;
    @Override
    public IDatabaseWrapper open(Context context, String mDbPath, String code, int flags) {
        mDBOpenHelper = new SQLiteOpenHelper(context,
                mDbPath + ".db", null, 1) {
            @Override
            public void onCreate(SQLiteDatabase sqLiteDatabase) {
            }

            @Override
            public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i2) {
            }
        };


        mDb = mDBOpenHelper.getWritableDatabase();
        return this;
    }

// other code
...

    @Override
    public void close() {
        mDBOpenHelper.close();
    }
}

Can you confirm if you see the same thing on your side?

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Cannot open SQLite connection, base error code: 14 - Works first time, but fails all subsequent times

I was running my unit tests with Robolectric 2.4 and got my tests working from referring to the https://github.com/robolectric/robolectric/issues/569 issue and incorporated what @hvu did and closed my db connection and helper connection. This helped all my DB related unit tests pass and not fail for the reasons mentioned in https://github.com/robolectric/robolectric/issues/569.

However, because I am looking to use some Shadows in 3.0 SNAPSHOT, I decided to use Robolectric 3.0 and play services shadows with multi dexing (https://github.com/robolectric/robolectric/issues/1399#issuecomment-79119297). However, after a lot of battling, I realized that only adding Robolectric 3.0-SNAPSHOT would cause the same problem mentioned in #569 . The following is my stack trace

android.database.sqlite.SQLiteException: Cannot open SQLite connection, base error code: 14
    at org.robolectric.shadows.ShadowSQLiteConnection.rethrow(ShadowSQLiteConnection.java:53)
    at org.robolectric.shadows.ShadowSQLiteConnection.access$600(ShadowSQLiteConnection.java:30)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections.execute(ShadowSQLiteConnection.java:443)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections.open(ShadowSQLiteConnection.java:345)
    at org.robolectric.shadows.ShadowSQLiteConnection.nativeOpen(ShadowSQLiteConnection.java:58)
    at android.database.sqlite.SQLiteConnection.nativeOpen(SQLiteConnection.java)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:209)
    at android.database.sqlite.SQLiteConnection.open(SQLiteConnection.java:193)
    at android.database.sqlite.SQLiteConnectionPool.openConnectionLocked(SQLiteConnectionPool.java:463)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:185)
    at android.database.sqlite.SQLiteConnectionPool.open(SQLiteConnectionPool.java:177)
    at android.database.sqlite.SQLiteDatabase.openInner(SQLiteDatabase.java:804)
    at android.database.sqlite.SQLiteDatabase.open(SQLiteDatabase.java:789)
    at android.database.sqlite.SQLiteDatabase.openDatabase(SQLiteDatabase.java:694)
    at android.app.ContextImpl.openOrCreateDatabase(ContextImpl.java:863)
    at android.content.ContextWrapper.openOrCreateDatabase(ContextWrapper.java:235)
    at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:224)
    at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:164)
    at com.core.database.AndroidDatabaseWrapper.open(AndroidDatabaseWrapper.java:31)
        ...
Caused by: com.almworks.sqlite4java.SQLiteException: [14] unable to open database file
    at com.almworks.sqlite4java.SQLiteConnection.open0(SQLiteConnection.java:1353)
    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:258)
    at com.almworks.sqlite4java.SQLiteConnection.open(SQLiteConnection.java:269)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$1.call(ShadowSQLiteConnection.java:352)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$1.call(ShadowSQLiteConnection.java:345)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$6.call(ShadowSQLiteConnection.java:429)
    at org.robolectric.shadows.ShadowSQLiteConnection$Connections$6.call(ShadowSQLiteConnection.java:423)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    ... 3 more

Here is my gradle settings

buildscript {
    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
    }
    dependencies {
        classpath 'org.robolectric:robolectric-gradle-plugin:0.14.+'
    }
}

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}

...

dependencies {
   ...
    // unit testing
    androidTestCompile fileTree(dir: 'libs/test', include: '*.jar')
    androidTestCompile('com.squareup:fest-android:1.0.+') {
        exclude group: 'com.android.support'
    }
    androidTestCompile 'com.google.dexmaker:dexmaker:1.+'

    androidTestCompile('junit:junit:4.11') {
        exclude module: 'hamcrest-core'
    }
    androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
    androidTestCompile 'org.mockito:mockito-core:1.9.5'
    androidTestCompile 'org.robolectric:android-all:+'
    androidTestCompile('org.robolectric:robolectric:3.0-SNAPSHOT') {
        exclude module: 'classworlds'
        exclude module: 'commons-logging'
        exclude module: 'httpclient'
        exclude module: 'maven-artifact'
        exclude module: 'maven-artifact-manager'
        exclude module: 'maven-error-diagnostics'
        exclude module: 'maven-model'
        exclude module: 'maven-project'
        exclude module: 'maven-settings'
        exclude module: 'plexus-container-default'
        exclude module: 'plexus-interpolation'
        exclude module: 'plexus-utils'
        exclude module: 'wagon-file'
        exclude module: 'wagon-http-lightweight'
        exclude module: 'wagon-provider-api'
    }

}

But when I were to change my dependency of robolectric to just 2.4, then my tests run perfectly fine. Just for reference my Android Database Wrapper has the following snippets

public class AndroidDatabaseWrapper implements IDatabaseWrapper {
    private SQLiteDatabase mDb;
    private SQLiteOpenHelper mDBOpenHelper;
    @Override
    public IDatabaseWrapper open(Context context, String mDbPath, String code, int flags) {
        mDBOpenHelper = new SQLiteOpenHelper(context,
                mDbPath + ".db", null, 1) {
            @Override
            public void onCreate(SQLiteDatabase sqLiteDatabase) {
            }

            @Override
            public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i2) {
            }
        };


        mDb = mDBOpenHelper.getWritableDatabase();
        return this;
    }

// other code
...

    @Override
    public void close() {
        mDBOpenHelper.close();
    }
}

Can you confirm if you see the same thing on your side?

utzcoz
utzcoz

@gkraft4 @Malachiasz @simtse does this problem exist on latest Robolectric 4.7.3? There are many improvement of SQLite supporting after Robolectric 3.x, and Robolectric 4.7 also added native SQLite supporting. This problem is too old, and related Robolectric version is also too old. I will close this problem, and feel free to reopen this problem if you find this problem also exists in latest Robolectric.

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Library version upgrade issue with roboelectric/blackduck

Hi Team, We are using Blackduck to fix Security and license issues. While using roboelectric with version 4.3, blackduck shows few libraries which requires version update to their latest version. As there are security risks for it. Following are the libraries list which require version update used with roboelectric:

com.ibm.icu:icu4j:53.1 ( used in org.robolectric:shadows-framework:4.3) icu4j

org.codehaus.plexus:plexus-utils:1.5.15 (used in org.robolectric:pluginapi:4.3)

It would be great if you can update these libraries.

Attached screenshot of Blackduck showing one of the libraries which require version upgrade.

blackduck_updated

utzcoz
utzcoz

@IngoHaumann-TomTom I have saw some vulnerability fixes after ICU4J 50.x, it's good to upgrade ICU4J version if there are other compatibility problems. I will send a PR to check it.

org.codehaus.plexus:plexus-utils:1.5.15 (used in org.robolectric:pluginapi:4.3)

It would be great if you can update these libraries.

@HighQMobile Looks like Robolectric pluginapi doesn't depend on it anymore. I will check dependency relationship locally.

Activity icon
fork

utzcoz forked unicode-org/icu

⚡ The new home of the ICU project source code.
utzcoz Updated
fork time in 2 days ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Library version upgrade issue with roboelectric/blackduck

Hi Team, We are using Blackduck to fix Security and license issues. While using roboelectric with version 4.3, blackduck shows few libraries which requires version update to their latest version. As there are security risks for it. Following are the libraries list which require version update used with roboelectric:

com.ibm.icu:icu4j:53.1 ( used in org.robolectric:shadows-framework:4.3) icu4j

org.codehaus.plexus:plexus-utils:1.5.15 (used in org.robolectric:pluginapi:4.3)

It would be great if you can update these libraries.

Attached screenshot of Blackduck showing one of the libraries which require version upgrade.

blackduck_updated

utzcoz
utzcoz

Four years later(!) and this vulnerability still exists. Using version 70.1 of ICU4J should fix this issue.

Thanks for mentioning this problem. I will send a PR to try fix it today.

Jan
20
4 days ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8)

I am trying to use robolectric with Android 12 SDK. My gradle file has

minSdkVersion 31 compileSdkVersion 31 targetSdkVersion 31

compileOptions { sourceCompatibility JavaVersion.VERSION_1_9 targetCompatibility JavaVersion.VERSION_1_9 }

testImplementation "org.robolectric:robolectric:4.7.3"

And in command line i have set export JAVA_HOME=/home/test/Downloads/jdk-9.0.4

and running test from same command line. Still seeing error as

java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8)

2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.plugins.DefaultSdkProvider$DefaultSdk.verifySupportedSdk(DefaultSdkProvider.java:168) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:284) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:68) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:236) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:93) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.run(ParentRunner.java:413) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:748) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] 2

Please help me to resolve this issue

utzcoz
utzcoz

@ck1703 Checking whether you have defined org.gradle.java.home at your gradle.properties. There is an problem related to this occasion: https://stackoverflow.com/questions/18487406/how-do-i-tell-gradle-to-use-specific-jdk-version.

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8)

I am trying to use robolectric with Android 12 SDK. My gradle file has

minSdkVersion 31 compileSdkVersion 31 targetSdkVersion 31

compileOptions { sourceCompatibility JavaVersion.VERSION_1_9 targetCompatibility JavaVersion.VERSION_1_9 }

testImplementation "org.robolectric:robolectric:4.7.3"

And in command line i have set export JAVA_HOME=/home/test/Downloads/jdk-9.0.4

and running test from same command line. Still seeing error as

java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8)

2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] java.lang.UnsupportedOperationException: Failed to create a Robolectric sandbox: Android SDK 31 requires Java 9 (have Java 8) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.plugins.DefaultSdkProvider$DefaultSdk.verifySupportedSdk(DefaultSdkProvider.java:168) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:284) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.RobolectricTestRunner.getSandbox(RobolectricTestRunner.java:68) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:236) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:93) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.run(ParentRunner.java:413) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:110) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:62) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:119) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2022-01-20T13:56:52.458+0530 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:748) 2022-01-20T13:56:52.459+0530 [DEBUG] [TestEventLogger] 2

Please help me to resolve this issue

utzcoz
utzcoz

$ java -version java version "9.0.4" Java(TM) SE Runtime Environment (build 9.0.4+11) Java HotSpot(TM) 64-Bit Server VM (build 9.0.4+11, mixed mode)

Still seeing the same issue

Looks like gradle also use Java 8. Maybe you should ensure your javac --version also show it is Java 9. If you are using Ubuntu/Debian, you can try https://computingforgeeks.com/how-to-set-default-java-version-on-ubuntu-debian/. I used this approach locally to manage OpenJDK version for different usage.

started
started time in 4 days ago
Jan
17
1 week ago
started
started time in 6 days ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Snapshots are not released

Hi, looking at the snapshots repository https://oss.sonatype.org/content/repositories/snapshots/org/robolectric/robolectric/ looks like last released snapshot was on November 5.

Did you stop releasing snapshots or something is broken? I came here because I tried to use 4.8-SNAPSHOT as stated here https://github.com/robolectric/robolectric/blob/master/README.md?plain=1#L64 but the artifacts are not uploaded

utzcoz
utzcoz

I think it is related to https://github.com/robolectric/robolectric/issues/6803. From 4.7, Robolectric started to support nativeruntime for SQLite, and SNAPSHOT is broken from that release. Previous mentioned issue is used to track this problem.

Jan
15
1 week ago
started
started time in 1 week ago
Jan
14
1 week ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

Overview

Proposed Changes

utzcoz
utzcoz

@utzcoz thank you too, this will help me get rid of some unnecessary code in my own custom shadow implementation that we use for testing our software

If you have other improvements for shadow or other parts, we're very welcome to contribute back. :)

Jan
13
1 week ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

Overview

Proposed Changes

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Kotlin Examples

Hi all,

Firstly, Robolectric is an awesome testing framework. I've been using it for many years.

Just a quick question, is there a plan to also include examples using kotlin? After all, kotlin has become the de facto language for developing Android applications

Please advise.

Thanks in advance and kind regards, rey malahay

utzcoz
utzcoz

We definitely could use more examples. The deckard-gradle example is quite outdated and obsolete. Contributions welcome on this front.

We also can write new tests of integration_tests with Kotlin and migrate current tests of integration_tests to Kotlin too. I always learn usage of Robolectric from those tests.

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Robolectric 4.7.3 @Config(sdk=28) - java.lang.NoClassDefFoundError: android/text/TextUtils

Description

With Robolectric 4.7.3 and @Config(sdk=28), I get the following exceptions when running unit tests.

Similar to: java.lang.NoClassDefFoundError: android/text/TextUtils #4085

java.lang.ExceptionInInitializerError
	at net.openid.appauth.Preconditions.checkNotEmpty(Preconditions.java:68)
	at net.openid.appauth.AuthorizationRequest$Builder.setClientId(AuthorizationRequest.java:614)
	at net.openid.appauth.AuthorizationRequest$Builder.<init>(AuthorizationRequest.java:586)
	at net.openid.appauth.AuthorizationRequest.jsonDeserialize(AuthorizationRequest.java:1056)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:591)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:274)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:88)
	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:834)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:181)
	at org.robolectric.internal.bytecode.RobolectricInternals.classInitializing(RobolectricInternals.java:21)
	at android.text.TextUtils.<clinit>(TextUtils.java)
	... 21 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.robolectric.internal.bytecode.RobolectricInternals.performStaticInitialization(RobolectricInternals.java:61)
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:178)
	... 23 more
Caused by: java.lang.NullPointerException
	at org.robolectric.shadows.ShadowLegacyAssetManager.getAndResolve(ShadowLegacyAssetManager.java:1106)
	at org.robolectric.shadows.ShadowLegacyAssetManager.getResourceText(ShadowLegacyAssetManager.java:285)
	at android.content.res.AssetManager.getResourceText(AssetManager.java)
	at android.content.res.Resources.getText(Resources.java:225)
	at android.content.res.Resources.getString(Resources.java:313)
	at android.text.TextUtils.__staticInitializer__(TextUtils.java:1704)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.robolectric.internal.bytecode.RobolectricInternals.performStaticInitialization(RobolectricInternals.java:61)
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:178)
	at org.robolectric.internal.bytecode.RobolectricInternals.classInitializing(RobolectricInternals.java:21)
	at android.text.TextUtils.<clinit>(TextUtils.java)
	at net.openid.appauth.Preconditions.checkNotEmpty(Preconditions.java:68)
	at net.openid.appauth.AuthorizationRequest$Builder.setClientId(AuthorizationRequest.java:614)
	at net.openid.appauth.AuthorizationRequest$Builder.<init>(AuthorizationRequest.java:586)
	at net.openid.appauth.AuthorizationRequest.jsonDeserialize(AuthorizationRequest.java:1056)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Robolectric & Android Version

OpenJDK version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Homebrew (build 11.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)
Gradle 6.5
------------------------------------------------------------

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.5.31
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.12 (Homebrew 11.0.12+0)
OS:           Mac OS X 11.6 x86_64
utzcoz
utzcoz

Caused by: java.lang.NullPointerException at org.robolectric.shadows.ShadowLegacyAssetManager.getAndResolve(ShadowLegacyAssetManager.java:1106)

Looks like your app uses legacy resource manager. Could you enable includeAndroidResources = true to test it with new resource manager, we maintain and develop now and future? There is an example:

android {
  testOptions {
    unitTests {
      includeAndroidResources = true
    }
  }
}
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

Robolectric 4.7.3 @Config(sdk=28) - java.lang.NoClassDefFoundError: android/text/TextUtils

Description

With Robolectric 4.7.3 and @Config(sdk=28), I get the following exceptions when running unit tests.

Similar to: java.lang.NoClassDefFoundError: android/text/TextUtils #4085

java.lang.ExceptionInInitializerError
	at net.openid.appauth.Preconditions.checkNotEmpty(Preconditions.java:68)
	at net.openid.appauth.AuthorizationRequest$Builder.setClientId(AuthorizationRequest.java:614)
	at net.openid.appauth.AuthorizationRequest$Builder.<init>(AuthorizationRequest.java:586)
	at net.openid.appauth.AuthorizationRequest.jsonDeserialize(AuthorizationRequest.java:1056)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.robolectric.RobolectricTestRunner$HelperTestRunner$1.evaluate(RobolectricTestRunner.java:591)
	at org.robolectric.internal.SandboxTestRunner$2.lambda$evaluate$0(SandboxTestRunner.java:274)
	at org.robolectric.internal.bytecode.Sandbox.lambda$runOnMainThread$0(Sandbox.java:88)
	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:834)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:181)
	at org.robolectric.internal.bytecode.RobolectricInternals.classInitializing(RobolectricInternals.java:21)
	at android.text.TextUtils.<clinit>(TextUtils.java)
	... 21 more
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.robolectric.internal.bytecode.RobolectricInternals.performStaticInitialization(RobolectricInternals.java:61)
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:178)
	... 23 more
Caused by: java.lang.NullPointerException
	at org.robolectric.shadows.ShadowLegacyAssetManager.getAndResolve(ShadowLegacyAssetManager.java:1106)
	at org.robolectric.shadows.ShadowLegacyAssetManager.getResourceText(ShadowLegacyAssetManager.java:285)
	at android.content.res.AssetManager.getResourceText(AssetManager.java)
	at android.content.res.Resources.getText(Resources.java:225)
	at android.content.res.Resources.getString(Resources.java:313)
	at android.text.TextUtils.__staticInitializer__(TextUtils.java:1704)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.robolectric.internal.bytecode.RobolectricInternals.performStaticInitialization(RobolectricInternals.java:61)
	at org.robolectric.internal.bytecode.ShadowWrangler.classInitializing(ShadowWrangler.java:178)
	at org.robolectric.internal.bytecode.RobolectricInternals.classInitializing(RobolectricInternals.java:21)
	at android.text.TextUtils.<clinit>(TextUtils.java)
	at net.openid.appauth.Preconditions.checkNotEmpty(Preconditions.java:68)
	at net.openid.appauth.AuthorizationRequest$Builder.setClientId(AuthorizationRequest.java:614)
	at net.openid.appauth.AuthorizationRequest$Builder.<init>(AuthorizationRequest.java:586)
	at net.openid.appauth.AuthorizationRequest.jsonDeserialize(AuthorizationRequest.java:1056)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

Robolectric & Android Version

OpenJDK version "11.0.12" 2021-07-20
OpenJDK Runtime Environment Homebrew (build 11.0.12+0)
OpenJDK 64-Bit Server VM Homebrew (build 11.0.12+0, mixed mode)
Gradle 6.5
------------------------------------------------------------

Build time:   2020-06-02 20:46:21 UTC
Revision:     a27f41e4ae5e8a41ab9b19f8dd6d86d7b384dad4

Kotlin:       1.5.31
Groovy:       2.5.11
Ant:          Apache Ant(TM) version 1.10.7 compiled on September 1 2019
JVM:          11.0.12 (Homebrew 11.0.12+0)
OS:           Mac OS X 11.6 x86_64
utzcoz
utzcoz

@felipezad Thanks for pointing out this problem. Could you help to provide a minimum project to reproduce this problem by following https://github.com/robolectric/robolectric/wiki/How-to-Report-Issues?

Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

java.lang.NoClassDefFoundError: android/text/TextUtils

With Robolectric 4.0 and @Config(sdk=26) or @Config(sdk=28), I get the following exceptions when running unit tests:

java.lang.NoClassDefFoundError: android/text/TextUtils
	at android.content.res.Configuration.setLayoutDirection(Configuration.java:1801)
	at android.content.res.Configuration.setLocales(Configuration.java:1720)
	at android.content.res.Configuration.setLocale(Configuration.java:1736)
	at org.robolectric.android.DeviceConfig.setLocale(DeviceConfig.java:388)
	at org.robolectric.android.DeviceConfig.applyRules(DeviceConfig.java:256)
	at org.robolectric.android.Bootstrap.applyQualifiers(Bootstrap.java:50)
	at org.robolectric.android.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:106)
	at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:377)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:252)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:130)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:42)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:84)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:117)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.base/java.lang.Thread.run(Thread.java:844)

and

java.lang.NoClassDefFoundError: android/text/TextUtils
	at android.content.res.Configuration.setLayoutDirection(Configuration.java:1801)
	at android.content.res.Configuration.setLocales(Configuration.java:1720)
	at android.content.res.Configuration.setLocale(Configuration.java:1736)
	at org.robolectric.android.DeviceConfig.setLocale(DeviceConfig.java:388)
	at org.robolectric.android.DeviceConfig.applyRules(DeviceConfig.java:256)
	at org.robolectric.android.Bootstrap.applyQualifiers(Bootstrap.java:50)
	at org.robolectric.android.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:106)
	at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:377)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:252)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:130)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:42)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:84)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:117)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: couldn't load android.text.TextUtils
	at org.robolectric.internal.bytecode.SandboxClassLoader.maybeInstrumentClass(SandboxClassLoader.java:136)
	at org.robolectric.internal.bytecode.SandboxClassLoader.lambda$findClass$0(SandboxClassLoader.java:111)
	at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:50)
	at org.robolectric.internal.bytecode.SandboxClassLoader.findClass(SandboxClassLoader.java:110)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:566)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
	at android.content.res.Configuration.$$robo$$android_content_res_Configuration$setLayoutDirection(Configuration.java:1801)
	at android.content.res.Configuration.setLayoutDirection(Configuration.java)
	at android.content.res.Configuration.$$robo$$android_content_res_Configuration$setLocales(Configuration.java:1720)
	at android.content.res.Configuration.setLocales(Configuration.java)
	at android.content.res.Configuration.$$robo$$android_content_res_Configuration$setLocale(Configuration.java:1736)
	at android.content.res.Configuration.setLocale(Configuration.java)
	at org.robolectric.android.DeviceConfig.setLocale(DeviceConfig.java:388)
	at org.robolectric.android.DeviceConfig.applyRules(DeviceConfig.java:256)
	at org.robolectric.android.Bootstrap.applyQualifiers(Bootstrap.java:50)
	at org.robolectric.android.internal.ParallelUniverse.setUpApplicationState(ParallelUniverse.java:106)
	at org.robolectric.RobolectricTestRunner.beforeTest(RobolectricTestRunner.java:377)
	at org.robolectric.internal.SandboxTestRunner$2.evaluate(SandboxTestRunner.java:252)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:130)
	at org.robolectric.internal.SandboxTestRunner.runChild(SandboxTestRunner.java:42)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.robolectric.internal.SandboxTestRunner$1.evaluate(SandboxTestRunner.java:84)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:106)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:58)
	at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:38)
	at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:117)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	... 11 more
Caused by: java.lang.IllegalArgumentException
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:160)
	at org.objectweb.asm.ClassReader.<init>(ClassReader.java:143)
	at org.robolectric.internal.bytecode.ClassNodeProvider.createClassNode(ClassNodeProvider.java:24)
	at org.robolectric.internal.bytecode.ClassNodeProvider.getClassNode(ClassNodeProvider.java:16)
	at org.robolectric.internal.bytecode.InstrumentingClassWriter.typeInfo(InstrumentingClassWriter.java:115)
	at org.robolectric.internal.bytecode.InstrumentingClassWriter.getCommonSuperClass(InstrumentingClassWriter.java:37)
	at org.objectweb.asm.ClassWriter.getMergedType(ClassWriter.java:1729)
	at org.objectweb.asm.Frame.merge(Frame.java:1530)
	at org.objectweb.asm.Frame.merge(Frame.java:1429)
	at org.objectweb.asm.MethodWriter.visitMaxs(MethodWriter.java:1497)
	at org.objectweb.asm.MethodVisitor.visitMaxs(MethodVisitor.java:867)
	at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:835)
	at org.objectweb.asm.tree.MethodNode.accept(MethodNode.java:727)
	at org.objectweb.asm.tree.ClassNode.accept(ClassNode.java:452)
	at org.robolectric.internal.bytecode.ClassInstrumentor.instrumentToBytes(ClassInstrumentor.java:80)
	at org.robolectric.internal.bytecode.SandboxClassLoader.lambda$maybeInstrumentClass$2(SandboxClassLoader.java:128)
	at org.robolectric.util.PerfStatsCollector.measure(PerfStatsCollector.java:50)
	at org.robolectric.internal.bytecode.SandboxClassLoader.maybeInstrumentClass(SandboxClassLoader.java:127)
	... 56 more

If this is a bug, it may be a regression of https://github.com/robolectric/robolectric/issues/585

utzcoz
utzcoz

@felipezad could you test it with latest Robolectric 4.7.3? And you can file a new issue for it if it has the same problem.

started
started time in 1 week ago
push

utzcoz push robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

commit sha: 0a4ca568ac725d580c39ae838f6f79928594da81

push time in 1 week ago
pull request

utzcoz pull request robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

Overview

Proposed Changes

Activity icon
issue

utzcoz issue robolectric/robolectric

utzcoz
utzcoz

ShadowBitmapFactory create with options does not set createdFromBytes

Description

When I create a new Bitmap using "BitmapFactory.decodeByteArray(byte[] data, int offset, int length)", the shadow implementation of the BitmapFactory sets the createdFromBytes field so I can easily get the original bytes that were used when creating the Bitmap. This is not the case for the overload "Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)"

Steps to Reproduce

byte[] bytes = new byte[10]; ShadowBitmap sb = shadowOf(Bitmap decodeByteArray(byte[] data, int offset, int length, BitmapFactory.Options opts)); assertEquals(bytes, sb.getCreatedFromBytes());

Robolectric & Android Version

robolectric 4.7.3

Link to a public git repo demonstrating the problem:

Jan
12
1 week ago
Activity icon
issue

utzcoz issue comment robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

Overview

Proposed Changes

utzcoz
utzcoz

Hi @hoisie , could you help to review this PR? Thanks.

Activity icon
issue

utzcoz issue comment farmerbb/Taskbar

utzcoz
utzcoz

Taskbar does not run properly on Android-x86

On Android-x86 9.0-r2 taskbar cannot open its settings dialog. It seems to crash: "Taskbar keeps stopping".

Furthermore, the title bar buttons of freeform windows don't work. The left button does nothing (no idea what it's supposed to do), the middle one seems to minimize the app (if that's its purpose) and the right one (fullscreen?) renders the background black, but the window remains unchanged.

utzcoz
utzcoz

Could you please point me to the commit? I'm just curious.

The change of ActivityLaunchParamsModifier in https://osdn.net/projects/android-x86/scm/git/frameworks-base/commits/f3b4e6b21d6372c2118cf7f200469c897b296929.

It seems that Android-x86's packages-apps-Taskbar is pretty far behind this master repository. Would it make sense to pull the missing commits before I build Android-x86?

I don't know whether Taskbar can built with hidden API helper library added recently. But you can try, or use older version before adding hidden API helper library.

Here you are.

The four buttons are for: pip, minimize, maximize(fullscreen) and close. See https://osdn.net/projects/android-x86/scm/git/frameworks-base/blobs/pie-x86/core/res/res/layout/decor_caption.xml.

Jan
11
1 week ago
Activity icon
issue

utzcoz issue comment android/android-test

utzcoz
utzcoz

Hi @brettchabot , could you help to review this PR? Thanks.

Sorry would you mind merging from master and pushing a new commit? The infrastructure that pulls this into google's infra to test it seems to have garbage collected this change

No problem. I have pushed new commit with rebasing on current master branch.

push

utzcoz push utzcoz/android-test

utzcoz
utzcoz

Bump Robolectric to 4.7.3

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Bump rules_jvm_external to 4.2

Signed-off-by: utzcoz [email protected]

utzcoz
utzcoz

Merge pull request #1225 from utzcoz:bump-Robolectric-to-4.7.3

PiperOrigin-RevId: 416071602

utzcoz
utzcoz

Set monitor, services, orchestrator versions for stable release.

PiperOrigin-RevId: 416100972

utzcoz
utzcoz

Increment annotation version too.

PiperOrigin-RevId: 416117871

utzcoz
utzcoz

Synchronize setting screen orientation for test activities that are destroyed and then recreated when their configuration is changed.

PiperOrigin-RevId: 416136849

utzcoz
utzcoz

Truncate view hierarchy in exception messages when it gets too large.

The view matcher exceptions dump the view hierarchy as well as the stack trace where the view matching fail. When the view hierarchy is too large, that stack trace is missing in the output. This truncates the view hierarchy in the exception message to 64KB including 2KB room for the stack trace.

If a full view hierarchy dump file has been created, that information is also added to the output message.

This also adds a new Espresso sample to generate truncated view hierarchy, with a matching failing test to validate the output contains the view hierarchy and that it is truncated enough to contain the relevant stack trace.

PiperOrigin-RevId: 416328749

utzcoz
utzcoz

Introduce ApplicationPackagePrefixSuite.

This is an alternative to AndroidClasspathSuite intended for large applications that encounter performance overhead and runtime errors.

PiperOrigin-RevId: 417691611

utzcoz
utzcoz

Add release info to github README

PiperOrigin-RevId: 418560659

utzcoz
utzcoz

Add JvmStatic annotation to onDevice() in EspressoDevice

PiperOrigin-RevId: 420320159

utzcoz
utzcoz

Fix error message in DeviceControllerModule

PiperOrigin-RevId: 420320235

utzcoz
utzcoz

Filter out inner classes from PackagePrefixClasspathSuite.

PiperOrigin-RevId: 420643618

utzcoz
utzcoz

Bump bazel to 4.2.2

Signed-off-by: utzcoz [email protected]

commit sha: 592eeaf9d473f69d23e8a0e07fba58f5ada79c24

push time in 1 week ago
Jan
10
2 weeks ago
Activity icon
issue

utzcoz issue comment farmerbb/Taskbar

utzcoz
utzcoz

Taskbar does not run properly on Android-x86

On Android-x86 9.0-r2 taskbar cannot open its settings dialog. It seems to crash: "Taskbar keeps stopping".

Furthermore, the title bar buttons of freeform windows don't work. The left button does nothing (no idea what it's supposed to do), the middle one seems to minimize the app (if that's its purpose) and the right one (fullscreen?) renders the background black, but the window remains unchanged.

utzcoz
utzcoz

I have compiled the pie-x86 branch of Android-x86 myself now. (Wow, that took a while!) Taskbar is now version 6.1.1 and behaves much better. The settings dialog can be opened and the fullscreen title bar button works too.

Cool. I know building Android-x86 is difficult for many guys. Congratulations.

However, although you can configure windows to open "large", it does not have any effect. Instead, Taskbar remembers the position and size changed by the user for each window, even if that is not configured. A bug?

It's not a bug. It's a feature. I have patched frameworks/base to persist window bounds.

The left and center title bar buttons still leave me stumped. While the middle one does something like minimizing, the left one does nothing. (Is there no description of the buttons anywhere?)

Could you provide a screenshot for title bar? I can explain functions of those buttons. Some are added by me, and some are added by @electrikjesus.

pull request

utzcoz merge to robolectric/robolectric

utzcoz
utzcoz

set createdFromBytes also when using decodeByteArray with options

Overview

Proposed Changes