yuliskov / SmartTube

SmartTube - an advanced player for set-top boxes and tvs running Android OS
https://www.patreon.com/smarttube
Other
19.8k stars 1.07k forks source link

error building... #622

Open aouamed opened 3 years ago

aouamed commented 3 years ago

Task :smarttubetv:compileStorigDebugJavaWithJavac FAILED /home/mido/Documents/SmartTubeNext/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/ui/mod/leanback/surfacefragment/TextureViewWrapper.java:14: error: package com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview does not exist import com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview.TextureViewSurfaceHolder;

ManuLinares commented 3 years ago

Same.

Tmp folder is in gitignore, so I'm assuming author is using Master as dev

maketvgithub commented 3 years ago

Any update on this? How should we use this project if not all files are included?

aouamed commented 3 years ago

same probleme...!

ManuLinares commented 3 years ago

Sorta joking, I'm worried my tv will start mining crypto, but no... irreproducible builds, sketchy APK updates... This is worrying, this is not open source.

https://github.com/yuliskov/SmartTubeNext/blob/master/common/src/main/res/values/update_urls.xml I can't validate the apks, would like to build for myself, and audit the release/beta apks.

https://github.com/yuliskov/SmartTubeNext/blob/master/common/build.gradle#L68 also building its own exoplayer fork, and where is the code for that?

maketvgithub commented 3 years ago

@ManuLinares, have you find a solution for this or some workaround?

ManuLinares commented 3 years ago

Added this to smarttubetv/build.gradle to remove multidex error implementation 'com.android.support:multidex:' + multiDexVersion

As of latest build, still can't compile with this error.

> Task :smarttubetv:compileStorigDebugJavaWithJavac FAILED
/home/user/source/SmartTubeNext/smarttubetv/src/main/java/com/liskovsoft/smartyoutubetv2/tv/ui/mod/leanback/surfacefragment/TextureViewWrapper.java:14: error: package com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview does not exist
import com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview.TextureViewSurfaceHolder;

Missing code... tmp is in gitignore, so the creator isn't uploading that code...

thestr4ng3r commented 3 years ago

jadx says this on the 11.22 apk with sha256 84aba4f439c28b5d7db4b04dea1245b8ffeea9ef924477aa38563bfc5b742524:

package com.liskovsoft.smartyoutubetv2.p011tv.p013ui.mod.leanback.tmp.surface.textureview;

import android.graphics.Canvas;
import android.graphics.Rect;
import android.view.Surface;
import android.view.SurfaceHolder;

/* renamed from: com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview.TextureViewSurfaceHolder */
public class TextureViewSurfaceHolder implements SurfaceHolder {
    private final Surface mSurface;

    public void addCallback(SurfaceHolder.Callback callback) {
    }

    public Rect getSurfaceFrame() {
        return null;
    }

    public boolean isCreating() {
        return false;
    }

    public Canvas lockCanvas() {
        return null;
    }

    public Canvas lockCanvas(Rect rect) {
        return null;
    }

    public void removeCallback(SurfaceHolder.Callback callback) {
    }

    public void setFixedSize(int i, int i2) {
    }

    public void setFormat(int i) {
    }

    public void setKeepScreenOn(boolean z) {
    }

    public void setSizeFromLayout() {
    }

    public void setType(int i) {
    }

    public void unlockCanvasAndPost(Canvas canvas) {
    }

    public TextureViewSurfaceHolder(Surface surface) {
        this.mSurface = surface;
    }

    public Surface getSurface() {
        return this.mSurface;
    }
}

Not much to see there, no idea why it is in gitignore.

ManuLinares commented 3 years ago

Still can't build/compile

Such a dumb issue, seems intentional

theScrabi commented 3 years ago

Try this branch. It compiles, but does not run propperly: https://github.com/theScrabi/SmartTubeNext/tree/fdroid

khaintt commented 3 years ago

Just create new class TextureViewSurfaceHolder which @thestr4ng3r mentioned above, replace missing one then you can build.

theScrabi commented 3 years ago

@ManuLinares why thumb down? Is something with my branch? @khaintt is there working code of of TextureViewSurfaceHolder, I just implemplemented it to so it compiles, I don't think for me it works yet.

ManuLinares commented 3 years ago

@theScrabi Anything not adding to the conversation, or half attempts I don't find useful, nothing personal.

@khaintt Do you have an example?

Is there a way to get the attention of the developer in this, the software could be amazing but if it doesn't compile it isn't open source.

theScrabi commented 3 years ago

I'm sorry you did not find this usefull. My branch compiled!

Check my last commit and you will see what needs to be changed. It does run, the app can be used, but you can not watch videos yet. Why I don't know yet. Propably because I do not have access to the yt api. Interestingly I can search videos however.

Isn't this better than not being able to compile at all? ;)

ntnguyen1234 commented 3 years ago

jadx says this on the 11.22 apk with sha256 84aba4f439c28b5d7db4b04dea1245b8ffeea9ef924477aa38563bfc5b742524:

package com.liskovsoft.smartyoutubetv2.p011tv.p013ui.mod.leanback.tmp.surface.textureview;
...

Not much to see there, no idea why it is in gitignore.

I added new TextureViewSurfaceHolder.java file in new tmp folder like the error wrote, edited the first line of this to

package com.liskovsoft.smartyoutubetv2.tv.ui.mod.leanback.tmp.surface.textureview;

then I could compile and export apk successfully. However, when I opened on the TV, it crashed. Not sure how to change that file to make it work.

theScrabi commented 3 years ago

@khaintt Does it only crash on your television or also on other devices?

@ManuLinares sorry, I didn't notice that my TextureViewSurfaceHolder was on the gitignore list and therfore was not commited. It is uploaded now.

I am not sure what and how much this file actually does but the next thing I would do is add print statements to find out which of the methods are actually in use, and if so how.

ManuLinares commented 3 years ago

@yuliskov Check this out please. tmp folder is in gitignore...

khaintt commented 3 years ago

@theScrabi nope, I tried on several devices like phone, custom tablet,... and it work fine.

yuliskov commented 3 years ago

@ManuLinares is problem solved right now?

ManuLinares commented 3 years ago

@ManuLinares is problem solved right now?

I think so, nice!

For reference: I had to

git clone https://github.com/yuliskov/SmartTubeNext.git
cd SmartTubeNext
git submodule update --init
#create a file named "local.properties" with the path to your sdk
sdk.dir=/home/user/Android/Sdk

Download my "google-services.json", steps below:

  1. Goto https://console.firebase.google.com/
  2. Select your project
  3. On the left menu, click on settings > project settings
  4. Add an app or download the google-services.json file under the Your Apps section.
  5. copy google-services.json to ./smarttubetv/google-services.json

Which one of these should I test on my TV

./gradlew assembleStstable ./gradlew assembleStdebug ./gradlew assembleStbeta

masyossi commented 3 years ago

@ManuLinares is problem solved right now?

I think so, nice!

For reference: I had to

git clone https://github.com/yuliskov/SmartTubeNext.git
cd SmartTubeNext
git submodule update --init
#create a file named "local.properties" with the path to your sdk
sdk.dir=/home/user/Android/Sdk

Download my "google-services.json", steps below:

  1. Goto https://console.firebase.google.com/
  2. Select your project
  3. On the left menu, click on settings > project settings
  4. Add an app or download the google-services.json file under the Your Apps section.
  5. copy google-services.json to ./smarttubetv/google-services.json

Which one of these should I test on my TV

./gradlew assembleStstable ./gradlew assembleStdebug ./gradlew assembleStbeta

i download my google-services.json and copy to ./smarttubetv/google-services/json the apk force close

marco20240618 commented 2 years ago

I don't want to be rude, but like someone said, the developer just uploaded some broken code intentionally.

I wasted a whole day, changed a lot of errors and built the apk, but when opened, it crashed immediately.

Don't waste your time.

han9over commented 2 years ago

I don't want to be rude, but like someone said, the developer just uploaded some broken code intentionally.

I wasted a whole day, changed a lot of errors and built the apk, but when opened, it crashed immediately.

Don't waste your time.

i was able to get compile and get installed but like you said it closes on launch. logs show that it is doing system.exit. i kept break points everywhere there is exit() call, but still closes on me.

zamazan4ik commented 2 years ago

@yuliskov Could you please clarify, how should we fix our local environments to make this stuff work for our local builds? I have found the same problem with missing google-service.json while I was trying to build it locally. I want to contribute some feature the the upstream but cannot do it since the build is broken.

Maybe we need to provide some additional guide for the contributors with additional steps for local setup.

Thanks in advance!

yuliskov commented 2 years ago

@zamazan4ik I've enabled crashlytics (google-services) for some flavors. Try to use flavor without this dependency (e.g. storig flavor). Below the example.

git clone 
https://github.com/yuliskov/SmartTubeNext.git
cd SmartTubeNext
git submodule update --init
adb connect <device_ip_address>
gradlew installStorigDebug
zamazan4ik commented 2 years ago

I have got the following error:

gradle wrapper installStorigDebug                                                                                                                                    16:56:42

> Configure project :appupdatechecker
WARNING: The option setting 'android.enableR8.fullMode=true' is experimental and unsupported.
The current default is 'false'.

WARNING: The option setting 'android.jetifier.blacklist=bcprov' is experimental and unsupported.

> Task :appupdatechecker2:checkStorigDebugManifest FAILED

FAILURE: Build failed with an exception.

* What went wrong:
A problem was found with the configuration of task ':appupdatechecker2:checkStorigDebugManifest' (type 'CheckManifest').
  - In plugin 'com.android.build.gradle.api.AndroidBasePlugin' type 'com.android.build.gradle.internal.tasks.CheckManifest' property 'manifest' has @Input annotation used on property of type 'File'.

    Reason: A property of type 'File' annotated with @Input cannot determine how to interpret the file.

    Possible solutions:
      1. Annotate with @InputFile for regular files.
      2. Annotate with @InputDirectory for directories.
      3. If you want to track the path, return File.absolutePath as a String and keep @Input.

    Please refer to https://docs.gradle.org/7.4.2/userguide/validation_problems.html#incorrect_use_of_input_annotation for more details about this problem.

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

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.4.2/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
2 actionable tasks: 1 executed, 1 up-to-date

gradle --version:

------------------------------------------------------------
Gradle 7.4.2
------------------------------------------------------------

Build time:   2022-03-31 15:25:29 UTC
Revision:     540473b8118064efcc264694cbcaa4b677f61041

Kotlin:       1.5.31
Groovy:       3.0.9
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          18.0.1.1 (Homebrew 18.0.1.1+0)
OS:           Mac OS X 12.4 aarch64
yuliskov commented 2 years ago

Maybe someting with gradle version. Project version is 6.9.1

Use command exactly as it is:

gradlew installStorigDebug

or

gradlew buildStorigDebug

zamazan4ik commented 2 years ago

Now it compiles fine and can be installed to the TV. Thanks a lot.

Application succefully starts, loads video previews, etc. But when I open any video, applicatoin is crashed with the following logs (got them with adb logcat):

06-18 19:29:48.437  1527  1551 D ApplicationSwitchService: ** ERROR: PROCESS CRASHED
06-18 19:29:48.437  1527  1551 D ApplicationSwitchService: processName: org.smartteam.smarttube.tv.orig
06-18 19:29:48.437  1527  1551 D ApplicationSwitchService: processPid: 32402
06-18 19:29:48.438  1527  1551 D ApplicationSwitchService: shortMsg: java.lang.NullPointerException
06-18 19:29:48.438  1527  1551 D ApplicationSwitchService: longMsg: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.view.View.isInTouchMode()' on a null object reference
06-18 19:29:48.438  1527  1551 D ApplicationSwitchService: timeMillis: 1655573388432
06-18 19:29:48.438  1527  1551 D ApplicationSwitchService: stack:
06-18 19:29:48.439   853 32550 I DropBoxManagerService: add tag=data_app_crash isTagEnabled=true flags=0x2
06-18 19:29:48.444   853  2345 W ActivityTaskManager:   Force finishing activity org.smartteam.smarttube.tv.orig/com.liskovsoft.smartyoutubetv2.tv.ui.browse.BrowseActivity
06-18 19:29:48.445   853  2345 W ActivityTaskManager:   Force finishing activity org.smartteam.smarttube.tv.orig/com.liskovsoft.smartyoutubetv2.tv.ui.playback.PlaybackActivity
06-18 19:29:48.465 32402 32402 I Process : Sending signal. PID: 32402 SIG: 9
06-18 19:29:48.485   853   879 W OomAdjuster: Failed to set scheduling policy, thread does not exist:
06-18 19:29:48.485   853   879 W OomAdjuster: java.lang.IllegalArgumentException: Given thread 32433 does not exist
06-18 19:29:48.489  3352  3352 D cr_CastToNative: [NativeApplicationObserver.java:141] onAppLaunched(name=STN Orig, sessionId=7662e33e-f2e8-48f5-84fa-afefb0941d84)
06-18 19:29:48.500   853   887 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
06-18 19:29:48.500   853   887 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
06-18 19:29:48.528   428   578 I debugdump: event->name javacrash#32402#org.smartteam.smarttube.tv.orig & eventName javacrash#32402#org.smartteam.smarttube.tv.orig
06-18 19:29:48.528   428   578 I debugdump: Duplicate Entry, ignore
06-18 19:29:48.528   428   576 V debugdump: server: msg recevied : javacrash#32402#org.smartteam.smarttube.tv.orig 47
06-18 19:29:48.528   428   576 V debugdump: parseMsg: pid = 32402, type = 2, maintype =java , subtype = crash, processname = org.smartteam.smarttube.tv.orig effect = visible
06-18 19:29:48.534   428   576 E debugdump: allowCreateDumpZip maxUploads = 20.
06-18 19:29:48.534   428   576 E debugdump: allowCreateDumpZip currentDumps = 3.
06-18 19:29:48.534   428   576 E debugdump: allowCreateDumpZip maxUploads++, allow.
06-18 19:29:48.535   428   576 V tpv_property: get property: persist.odm.tpv.sys.dumpcount, 102, length:3
06-18 19:29:48.535   428   576 V tpv_property: set property: persist.odm.tpv.sys.dumpcount, 103
06-18 19:29:48.538   853  3266 I AlarmManager: Change Wakeup Alarm type to non Wakeup type, current type=[3] packageName = com.google.android.gms statsTag = *alarm*:com.google.android.chimera.container.IntentOperationService.SAVED_INTENT @315385601222 and next wakeup alarm is @Sat Jun 18 12:23:07 GMT+02:00 2022
06-18 19:29:48.540  3352  3352 I chromium: [3352:3352:INFO:application_manager_impl.cc(684)] Starting app: app_id=AndroidNativeApp, session_id=7662e33e-f2e8-48f5-84fa-afefb0941d84, launch_from=FROM_LOCAL, , virtual_device_id=[REDACTED], session_owner=, group_session_id=, headless=1, silent_launch_enabled=0, action_script_id=, supported_app_types={ANDROID_TV,}, take_resources=1
06-18 19:29:48.586   311   311 I Zygote  : Process 32402 exited due to signal 9 (Killed)
06-18 19:29:48.587   853  3266 I WindowManager: WIN DEATH: Window{aff5327 u0 org.smartteam.smarttube.tv.orig/com.liskovsoft.smartyoutubetv2.tv.ui.browse.BrowseActivity}
06-18 19:29:48.588  3477  3703 D vol.MediaSessions: onActiveSessionsUpdatedH n=0
06-18 19:29:48.588   853  2345 I ActivityManager: Process org.smartteam.smarttube.tv.orig (pid 32402) has died: prcp TOP 
06-18 19:29:48.589  3477  3703 D vol.MediaSessions: Removing STN Orig sentRemote=false
06-18 19:29:48.589  1136  1136 V AvrcpMediaPlayerList: onActiveSessionsChanged: number of controllers: 0
06-18 19:29:48.589  2692  2692 D NowPlayingListener: onActiveSessionsChanged() called with: controllers = [[]], lastActiveMediaController = null, lastUpdatedAppPackageName = org.smartteam.smarttube.tv.orig
06-18 19:29:48.589   853   889 I libprocessgroup: Successfully killed process cgroup uid 10084 pid 32402 in 0ms
06-18 19:29:48.590  2692  2692 D NowPlayingManager: onClientChanged() called
06-18 19:29:48.591  2692  2692 D NowPlayingManager: A notification for Now Playing Card has been canceled
06-18 19:29:48.597  1500  6685 D xtvService: xtvService handleConnectAurora 
06-18 19:29:48.598  1500  6685 D xtvAuroraClient: connectAuroraService:
06-18 19:29:48.598  1500  6685 D xtvAuroraClient: connectAuroraService: intent is null
yuliskov commented 2 years ago

@zamazan4ik I need to test your apk on my setup. Please send it to me by email (first.hash at gmail.com) or via telegram t.me/yurok9711