Code Monkey home page Code Monkey logo

jaredsburrows / android-gif-search Goto Github PK

View Code? Open in Web Editor NEW
400.0 12.0 50.0 2.39 MB

Gif LazyVerticalGrid MVVM using Dagger 2 + Hilt with Retrofit 2, Moshi, Kotlin Coroutines, JUnit, Espresso and Robolectric tests!

Home Page: https://play.google.com/store/apps/details?id=com.burrowsapps.gif.search

License: Apache License 2.0

Kotlin 63.25% HTML 36.75%
espresso junit android-gif moshi kotlin-dsl kotlin kotlin-android robolectric ktlint dagger2

android-gif-search's Introduction

Gif Search using Jetpack Compose + Kotlin

License build Twitter Follow

Gif LazyVerticalGrid MVVM using Dagger 2 + Hilt with Retrofit 2, Moshi, Kotlin Coroutines, JUnit, Espresso and Robolectric tests!

Get it on Google Play

Build

Build the APK:

gradlew assembleDebug

Install the APK:

gradlew installDebug

Test

Run Junit Unit Tests:

gradlew testDebug

Run Espresso Instrumentation Tests:

gradlew connectedDebugAndroidTest

Report

Generate Dex Method Count Report:

gradlew countDebugDexMethods

Generate License Report:

gradlew licenseDebugReport

Generate Lint Report:

gradlew lintDebug

Local Debug Run

gradlew dependencyUpdates
osv-scanner -r . && \

gradlew ktlintCheck && \
gradlew ktlintFormat && \

gradlew lintDebug && \
gradlew lintFixDebug  && \

gradlew testDebug

License

Copyright (C) 2017 Jared Burrows

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

android-gif-search's People

Contributors

dependabot[bot] avatar eskatos avatar jaredsburrows avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-gif-search's Issues

OutOfMemoryError

Searching for GIFs eventually causes an OutOfMemoryError. Maybe you should only load search results in onQueryTextSubmit(String) instead of onQueryTextChange(String).

09-15 17:45:23.160 18409-18480/burrows.apps.giphy.example E/PriorityExecutor: Request threw uncaught throwable
  java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: Failed to allocate a 12550156 byte allocation with 3777264 free bytes and 3MB until OOM
      at java.util.concurrent.FutureTask.report(FutureTask.java:94)
      at java.util.concurrent.FutureTask.get(FutureTask.java:164)
      at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor.afterExecute(FifoPriorityThreadPoolExecutor.java:96)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1121)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
      at java.lang.Thread.run(Thread.java:818)
      at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118)
   Caused by: java.lang.OutOfMemoryError: Failed to allocate a 12550156 byte allocation with 3777264 free bytes and 3MB until OOM
      at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91)
      at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201)
      at com.bumptech.glide.load.resource.gif.GifResourceDecoder.inputStreamToBytes(GifResourceDecoder.java:106)
      at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:57)
      at com.bumptech.glide.load.resource.gif.GifResourceDecoder.decode(GifResourceDecoder.java:26)
      at com.bumptech.glide.load.resource.file.FileToStreamDecoder.decode(FileToStreamDecoder.java:39)
      at com.bumptech.glide.load.resource.file.FileToStreamDecoder.decode(FileToStreamDecoder.java:17)
      at com.bumptech.glide.load.engine.DecodeJob.loadFromCache(DecodeJob.java:222)
      at com.bumptech.glide.load.engine.DecodeJob.cacheAndDecodeSourceData(DecodeJob.java:207)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromSourceData(DecodeJob.java:187)
      at com.bumptech.glide.load.engine.DecodeJob.decodeSource(DecodeJob.java:177)
      at com.bumptech.glide.load.engine.DecodeJob.decodeFromSource(DecodeJob.java:128)
      at com.bumptech.glide.load.engine.EngineRunnable.decodeFromSource(EngineRunnable.java:122)
      at com.bumptech.glide.load.engine.EngineRunnable.decode(EngineRunnable.java:101)
      at com.bumptech.glide.load.engine.EngineRunnable.run(EngineRunnable.java:58)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:423)
      at java.util.concurrent.FutureTask.run(FutureTask.java:237)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588) 
      at java.lang.Thread.run(Thread.java:818) 
      at com.bumptech.glide.load.engine.executor.FifoPriorityThreadPoolExecutor$DefaultThreadFactory$1.run(FifoPriorityThreadPoolExecutor.java:118) 

Fix espresso tests on API 19 and lower

Tests on API19(AVD) - 4.4.2 failed: Instrumentation run failed due to 'java.lang.IllegalAccessError'

com.android.builder.testing.ConnectedDevice > No tests found.[API19(AVD) - 4.4.2] FAILED 
No tests found. This usually means that your test classes are not in the form that your test runner expects (e.g. don't inherit from TestCase or lack @Test annotations).
:connectedDebugAndroidTest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':connectedDebugAndroidTest'.
> There were failing tests. See the report at: file:///<>/android-gif-example/build/reports/androidTests/connected/index.html

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 3 mins 39.422 secs

and from Travis:
screen shot 2016-10-02 at 2 38 17 pm

Use Jack

Docs:

Todo:

Other issues that do not prevent this from being merged:

Plugin unsupported on gradle 5.4.1

Log:
com.android.tools.idea.gradle.project.sync.ng.NewGradleSyncNotSupportedException: New Gradle Sync is not supported due to containing Kotlin modules using an unsupported plugin version

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Ignored or Blocked

These are blocked by an existing closed PR and will not be recreated unless you click a checkbox below.

Detected dependencies

github-actions
.github/workflows/build.yml
  • actions/checkout v4.1.4
  • gradle/actions v3.3.2
  • actions/setup-java v4.2.1
  • gradle/actions v3.3.2
  • EnricoMi/publish-unit-test-result-action v2.16.1
  • actions/cache v4.0.2
  • reactivecircus/android-emulator-runner v2.30.1
  • reactivecircus/android-emulator-runner v2.30.1
  • EnricoMi/publish-unit-test-result-action v2.16.1
  • actions/upload-artifact v4.3.3
  • actions/upload-artifact v4.3.3
  • actions/upload-artifact v4.3.3
gradle
gradle.properties
settings.gradle.kts
  • com.gradle.develocity 3.17.2
build.gradle.kts
app/build.gradle.kts
gradle/libs.versions.toml
  • com.android.tools:desugar_jdk_libs 2.0.4
  • androidx.activity:activity-ktx 1.9.0
  • androidx.activity:activity-compose 1.9.0
  • androidx.annotation:annotation 1.7.1
  • androidx.appcompat:appcompat 1.6.1
  • androidx.compose:compose-bom 2024.05.00
  • androidx.compose.compiler:compiler 1.5.13
  • androidx.compose.material:material 1.6.7
  • androidx.compose.material3:material3 1.2.1
  • androidx.navigation:navigation-compose 2.7.7
  • androidx.compose.runtime:runtime 1.6.7
  • androidx.compose.ui:ui 1.6.7
  • androidx.compose.ui:ui-test-manifest 1.6.7
  • androidx.compose.ui:ui-tooling 1.6.7
  • androidx.compose.ui:ui-tooling-preview 1.6.7
  • androidx.compose.ui:ui-test-junit4 1.6.7
  • androidx.core:core-ktx 1.13.1
  • androidx.hilt:hilt-navigation-compose 1.2.0
  • androidx.lifecycle:lifecycle-viewmodel-ktx 2.7.0
  • com.kmpalette:kmpalette-core 3.1.0
  • androidx.startup:startup-runtime 1.1.1
  • androidx.test:annotation 1.0.1
  • androidx.test:core 1.5.0
  • androidx.test.ext:junit 1.1.5
  • androidx.test:orchestrator 1.4.2
  • androidx.test:rules 1.5.0
  • androidx.test:runner 1.5.2
  • androidx.webkit:webkit 1.11.0
  • com.github.bumptech.glide:glide 4.16.0
  • com.github.bumptech.glide:ksp 4.16.0
  • com.github.bumptech.glide:okhttp3-integration 4.16.0
  • org.glassfish:javax.annotation 10.0-b28
  • com.google.accompanist:accompanist-drawablepainter 0.34.0
  • com.google.accompanist:accompanist-swiperefresh 0.34.0
  • com.google.code.findbugs:jsr305 3.0.2
  • com.google.dagger:hilt-android 2.51.1
  • com.google.dagger:hilt-android-compiler 2.51.1
  • com.google.dagger:hilt-android-testing 2.51.1
  • com.google.android.material:material 1.12.0
  • com.google.truth:truth 1.4.2
  • com.jakewharton.timber:timber 5.0.1
  • javax.annotation:jsr250-api 1.0
  • junit:junit 4.13.2
  • org.jetbrains.kotlin:kotlin-bom 1.9.23
  • org.jetbrains.kotlinx:kotlinx-coroutines-android 1.8.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-bom 1.8.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-core 1.8.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-test 1.8.0
  • org.jetbrains.kotlinx:kotlinx-coroutines-jdk8 1.8.0
  • com.github.skydoves:landscapist-animation 2.3.3
  • com.github.skydoves:landscapist-glide 2.3.3
  • com.github.skydoves:landscapist-palette 2.3.3
  • org.mockito:mockito-inline 5.2.0
  • com.nhaarman.mockitokotlin2:mockito-kotlin 2.2.0
  • org.robolectric:robolectric 4.12.1
  • org.robolectric:annotations 4.12.1
  • com.squareup.leakcanary:leakcanary-android-startup 2.14
  • com.squareup.leakcanary:leakcanary-android-instrumentation 2.14
  • com.squareup.moshi:moshi 1.15.1
  • com.squareup.moshi:moshi-adapters 1.15.1
  • com.squareup.moshi:moshi-kotlin-codegen 1.15.1
  • com.squareup.okhttp3:okhttp 4.12.0
  • com.squareup.okhttp3:okhttp-bom 4.12.0
  • com.squareup.okhttp3:logging-interceptor 4.12.0
  • com.squareup.okhttp3:mockwebserver 4.12.0
  • com.squareup.okio:okio 3.9.0
  • com.squareup.retrofit2:retrofit 2.11.0
  • com.squareup.retrofit2:converter-moshi 2.11.0
  • com.android.application 8.4.0
  • com.android.library 8.4.0
  • com.google.devtools.ksp 1.9.23-1.0.20
  • com.google.dagger.hilt.android 2.51.1
  • org.jlleitschuh.gradle.ktlint 12.1.0
  • com.jaredsburrows.license 0.9.7
  • com.github.ben-manes.versions 0.51.0
  • com.getkeepsafe.dexcount 4.0.0
  • com.github.triplet.play 3.9.1
test-shared/build.gradle.kts
gradle-wrapper
gradle/wrapper/gradle-wrapper.properties
  • gradle 8.7

  • Check this box to trigger a request for Renovate to run again on this repository

Question not an issue

Hi Jared,
How did you generate project-scheme.json under gradle folder?
I was facing a similar issue you had regarding "Unresolved reference: compile".

My build was working with gradle 4.0.2, but not any version after that.

Thanks,
HL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.