Hello @nezorflame,
I've build opengapps 10 using aosp_build and my buildscript:
https://github.com/stefanhh0/aosp-10/blob/master/build-4.9.sh
Kernel version: 4.9.210
Android version: android-10.0.0_r21
Your latest fixes (https://gitlab.opengapps.org/opengapps/arm64/commit/df329d5eca53c7aaa6360a80c2e05a52866c0edb) are included in that build.
However the setup wizard crashes on one of the screens.
Seems like the missing libcore.util.TimeZoneFinder causes the problem:
01-27 03:57:08.648 6282 6282 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@fd50c21
01-27 03:57:08.663 6282 6282 D AndroidRuntime: Shutting down VM
01-27 03:57:08.664 6282 6282 E AndroidRuntime: FATAL EXCEPTION: main
01-27 03:57:08.664 6282 6282 E AndroidRuntime: Process: com.google.android.setupwizard, PID: 6282
01-27 03:57:08.664 6282 6282 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Llibcore/util/TimeZoneFinder;
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.google.android.setupwizard.time.ZonePicker.findTimeZonesForLocale(ZonePicker.java:311)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.google.android.setupwizard.time.ZonePicker.access$000(ZonePicker.java:60)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.google.android.setupwizard.time.ZonePicker$ZoneGetter.addZonesFromResource(ZonePicker.java:333)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.google.android.setupwizard.time.ZonePicker.constructTimezoneAdapter(ZonePicker.java:70)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.google.android.setupwizard.time.DateTimeActivity.onCreate(DateTimeActivity.java:112)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7825)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7814)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1306)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:107)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
01-27 03:57:08.664 6282 6282 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: libcore.util.TimeZoneFinder
01-27 03:57:08.664 6282 6282 E AndroidRuntime: ... 20 more
01-27 03:57:08.666 1091 7155 I DropBoxManagerService: add tag=system_app_crash isTagEnabled=true flags=0x2
01-27 03:57:08.666 1091 2632 W ActivityTaskManager: Force finishing activity com.google.android.setupwizard/.time.DateTimeActivity
01-27 03:57:08.671 1091 1203 I ActivityManager: Showing crash dialog for package com.google.android.setupwizard u0
01-27 03:57:08.672 1091 1203 E system_server: Invalid ID 0x00000000.
FInd attached as well, the full logcat log:
logcat.log
@nezorflame I've reverted the SetupWizard using the one from
https://dl.google.com/dl/android/aosp/coral-qq1b.200105.004-factory-143dfd87.zip
Path: /product/priv-app/SetupWizardPrebuilt/SetupWizardPrebuilt.apk
That is versionCode=2842 instead of versionCode=3325 that is currently included in the opengapps gitlab. Would it be possible that you revert to the working version until the root cause has been fixed? That would be great!
Hi.
arm64 never have faced such an issue (actually, it was arm devices that had it some time ago, and the SetupWizard update helped them).
The thing is that TimeZoneFinder class is no longer present in libcore.util.TimeZoneFinder in Q, Google has moved it to the libcore.timezone.TimeZoneFinder instead (see this for reference)... I wonder why your ROM does request it.
So far you're the only one with this issue, my setup on Q works fine. I could roll it back, but first I would like to understand why does it fail for you.
Okay interesting, I don't know much about how these APK's work. I just tried to look into it. Extracted classes.dex from the 3325.apk, used d2j-dex2jar.sh and then opened DateTimeActivity in eclipse using a decompiler. I couldn't find a ZonePicker in the created jar and have no clue how that class comes into play.
And DateTimeActivity:112 looks as follows:
this.n = (TextView) this.findViewById(2131362077);
DateTimeActivity.java
package com.google.android.setupwizard.time;
import android.app.AlarmManager;
import android.content.BroadcastReceiver;
import android.content.IntentFilter;
import android.icu.text.DateFormat;
import android.icu.text.DisplayContext;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.LinearLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.AdapterView.OnItemSelectedListener;
import com.google.android.setupdesign.GlifLayout;
import java.util.Calendar;
import java.util.Date;
import java.util.TimeZone;
public class DateTimeActivity extends aip implements OnClickListener, OnItemSelectedListener {
private static final aop h = new aop(DateTimeActivity.class);
private static final IntentFilter i = new IntentFilter("android.intent.action.TIME_TICK");
private static final IntentFilter j = new IntentFilter("android.intent.action.TIMEZONE_CHANGED");
private aye k;
private Spinner l;
private TextView m;
private TextView n;
private final BroadcastReceiver o = new axw(this);
public final void f() {
int var2;
if (this.k != null) {
TimeZone var1 = TimeZone.getDefault();
var2 = ayi.a(this.k, var1);
} else {
var2 = -1;
}
Spinner var3 = this.l;
if (var3 != null && var2 >= 0) {
var3.setSelection(var2);
}
}
public final void g() {
bcj.a(this);
long var1 = System.currentTimeMillis();
this.k.notifyDataSetChanged();
Date var3 = new Date(var1);
DateFormat var4 = DateFormat.getInstanceForSkeleton("EMMMdy",
this.getResources().getConfiguration().getLocales().get(0));
var4.setContext(DisplayContext.CAPITALIZATION_FOR_STANDALONE);
this.m.setText(var4.format(var3.getTime()));
this.n.setText(android.text.format.DateFormat.getTimeFormat(this).format(var3));
}
public final void onClick(View var1) {
int var2 = var1.getId();
if (var2 == 2131361895) {
(new axx()).show(this.getFragmentManager(), "Dialog");
} else {
if (var2 == 2131362078) {
(new axy()).show(this.getFragmentManager(), "Dialog");
}
}
}
protected final void onCreate(Bundle var1) {
super.onCreate(var1);
if (var1 == null) {
ayd var7 = ayd.a(this);
if (!var7.a() || !var7.b()) {
bee.h(this).edit().putBoolean("show_date_time_screen", true).apply();
}
if (!bee.h(this).getBoolean("show_date_time_screen", false)) {
aop var12 = h;
String var13 = String.valueOf((new Date()).toString());
if (var13.length() == 0) {
var13 = new String("Skipping, as date and time zone have already been set; date=");
} else {
var13 = "Skipping, as date and time zone have already been set; date=".concat(var13);
}
var12.c(var13);
this.c(-1);
return;
}
bcj var8 = bcj.a(this);
long var3 = (Long) bel.a.a();
Calendar var2 = Calendar.getInstance();
var2.setTimeInMillis(var3 * 1000L);
var2.set(2, 0);
var2.set(5, 1);
var2.set(11, 12);
var2.set(12, 0);
var2.set(13, 0);
var2.set(14, 0);
if (var2.after(Calendar.getInstance())) {
var8.a(var2);
}
}
this.setContentView(2131558431);
((LinearLayout) this.findViewById(2131361895)).setOnClickListener(this);
this.m = (TextView) this.findViewById(2131361894);
((LinearLayout) this.findViewById(2131362078)).setOnClickListener(this);
this.n = (TextView) this.findViewById(2131362077);
this.l = (Spinner) this.findViewById(2131362080);
agk var10 = (agk) ((GlifLayout) this.findViewById(2131362006)).a(agk.class);
axv var5 = new axv(this);
agl var9 = new agl(this);
var9.a(2131755319);
var9.b = var5;
var9.c = 5;
var9.d = 2131820808;
var10.a(var9.a());
if (this.l != null) {
aye var11 = ayi.a(this);
this.k = var11;
this.l.setAdapter(var11);
}
int var6 = this.k.a;
if (var6 > 0) {
this.l.setSelection(var6);
}
}
public final void onItemSelected(AdapterView var1, View var2, int var3, long var4) {
ayf var6 = (ayf) var1.getItemAtPosition(var3);
bcj var8 = bcj.a(this);
String var7 = var6.d.getID();
AlarmManager var9 = (AlarmManager) var8.b.getSystemService(AlarmManager.class);
if (var9 != null && var7 != null) {
var9.setTimeZone(var7);
} else {
aop var10 = bcj.a;
var7 = String.valueOf(var7);
if (var7.length() == 0) {
var7 = new String("failed to set the system timezone to ");
} else {
var7 = "failed to set the system timezone to ".concat(var7);
}
var10.e(var7);
}
this.g();
}
public final void onNothingSelected(AdapterView var1) {
}
protected final void onPause() {
Spinner var1 = this.l;
if (var1 != null) {
var1.setOnItemSelectedListener((OnItemSelectedListener) null);
this.unregisterReceiver(this.o);
}
super.onPause();
}
protected final void onResume() {
super.onResume();
if (this.l != null) {
this.registerReceiver(this.o, i);
this.registerReceiver(this.o, j);
this.l.setOnItemSelectedListener(this);
this.f();
this.g();
}
}
}
So that seems to be not a valid approach to look into that issue. I guess all closed source? Or do you know where to find the source code for: com.google.android.setupwizard?
On the other hand I can live with that problem for now, since when using the setupwizard from the factory image the problem does not occur.
Why do you think it is problem of the rom rather then the SetupWizard apk itself? Just asking since that is not clear to me. Have you tried running the SetupWizard 3325.apk on a freshly flashed device (including flashing userdata) on Android branch android-10.0.0_r21?
If you have done it on a different branch, then you should double-check that the branch does not have a util.TimeZoneFinder
I have checked as well how it is currently:
stefan@mars:~/android/source$ find . -wholename "*libcore/util/TimeZoneFinder.java"
stefan@mars:~/android/source$ find . -wholename "*libcore/timezone/TimeZoneFinder.java"
./libcore/luni/src/main/java/libcore/timezone/TimeZoneFinder.java
./out/soong/.intermediates/libcore/mmodules/core_platform_api/core-platform-api-stubs/android_common/stubsDir/libcore/timezone/TimeZoneFinder.java
Would be great if you could have a second look at it or if you could give me a hint, how I could continue figure out what is going on.
WIth the help of Marijn I found the reason for the problem.
https://github.com/opengapps/aosp_build/blob/master/core/prebuilt_apk.mk searches first for all and finds the all/priv-app/com.google.android.setupwizard.default/28/nodpi/228.apk
However it should pick the ARCH specific setupwizard from:
arm64/priv-app/com.google.android.setupwizard.default/29/nodpi/3325.apk
I am testing currently a change of the prebuilt_apk that changes the order accordingly and going to make a PR.
Thank you for a dive-in! And yes, I've missed that one - the OpenGApps's build script already does that, so I thought that aosp_build's one does that as well. Turns out, it doesn't. Great find!
I hope someone will also be able to fix SetupWraith(tvstock) for AndoidTV Pie.
It doesn't pick up any wifi network and also doesn't allow you to use a phone or the device itself to login, then it shows the Google Assistant screen for half a second and jumps back to the language selection screen. You can only complete the setup with an ethernet connection and using a PC to sign-in, not on the device itself.
@mo123 You should open a separate issue for it, if not already done. Just did a quick-check and found it is only as generic and not as ARCH package available. So it is not related to this issue.
@Blystad thanks for merging, closing this one now.
Most helpful comment
WIth the help of Marijn I found the reason for the problem.
https://github.com/opengapps/aosp_build/blob/master/core/prebuilt_apk.mk searches first for all and finds the all/priv-app/com.google.android.setupwizard.default/28/nodpi/228.apk
However it should pick the ARCH specific setupwizard from:
arm64/priv-app/com.google.android.setupwizard.default/29/nodpi/3325.apk
I am testing currently a change of the prebuilt_apk that changes the order accordingly and going to make a PR.