I have setup the edx android app, But when i click on find course item, App Crashed

208 views
Skip to first unread message

Deepak Panwar

unread,
Aug 14, 2015, 6:59:47 AM8/14/15
to General Open edX discussion
I have setup the edx android app, But when i click on find course item, App Crashed
I have debug all the way.
Found

public class CourseInfoActivity extends FindCoursesBaseActivity {

public static final String EXTRA_PATH_ID = "path_id";

@Override
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_find_course_info);
//after this call to a super class for setContentView
// app crashes 
super.onCreate(savedInstanceState);

try{
environment.getSegment().screenViewsTracking(ISegment.Values.COURSE_INFO_SCREEN);
}catch(Exception e){
logger.error(e);
}
}
}

//crashing point
@Override
public void setContentView(int layoutResID) {
super.setContentView(layoutResID);
}

I am not getting why it si happening, Even i debug for path_id
It comes as https://webview.edx.org/course/rise-superheroes-impact-pop-culture-smithsonianx-popx1-1x-0
and it is opening in webbrowser, but in app it crashed
Please suggest me some helping points to resolve this.



08-14 16:26:23.602  14592-18873/org.edx.mobile E/org.edx.mobile.view.custom.URLInterceptorWebViewClient? java.lang.NullPointerException: Attempt to invoke virtual method 'org.edx.mobile.util.Config$ZeroRatingConfig org.edx.mobile.util.Config.getZeroRatingConfig()' on a null object reference
            at org.edx.mobile.util.ConfigUtil.isWhiteListedURL(ConfigUtil.java:16)
            at org.edx.mobile.view.custom.URLInterceptorWebViewClient.shouldInterceptRequest(URLInterceptorWebViewClient.java:195)
            at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:325)
            at com.android.org.chromium.android_webview.AwContents$IoThreadClientImpl.shouldInterceptRequest(AwContents.java:348)
            at com.android.org.chromium.android_webview.AwContentsIoThreadClient.shouldInterceptRequest(AwContentsIoThreadClient.java:61)
08-14 16:26:23.603  14592-18873/org.edx.mobile E/org.edx.mobile.view.custom.URLInterceptorWebViewClient? java.lang.NullPointerException: Attempt to invoke virtual method 'org.edx.mobile.util.Config$ZeroRatingConfig org.edx.mobile.util.Config.getZeroRatingConfig()' on a null object reference
            at org.edx.mobile.util.ConfigUtil.isWhiteListedURL(ConfigUtil.java:16)
            at org.edx.mobile.view.custom.URLInterceptorWebViewClient.shouldInterceptRequest(URLInterceptorWebViewClient.java:175)
            at android.webkit.WebViewClient.shouldInterceptRequest(WebViewClient.java:125)
            at org.edx.mobile.view.custom.URLInterceptorWebViewClient.shouldInterceptRequest(URLInterceptorWebViewClient.java:204)
            at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:325)
            at com.android.org.chromium.android_webview.AwContents$IoThreadClientImpl.shouldInterceptRequest(AwContents.java:348)
            at com.android.org.chromium.android_webview.AwContentsIoThreadClient.shouldInterceptRequest(AwContentsIoThreadClient.java:61)
08-14 16:26:23.672  14592-14592/org.edx.mobile D/org.edx.mobile.view.custom.URLInterceptorWebViewClient? loading: edxapp://course_info?path_id=course/rise-superheroes-impact-pop-culture-smithsonianx-popx1-1x-0
08-14 16:26:23.676  14592-14592/org.edx.mobile D/org.edx.mobile.view.FindCoursesActivity? PathIdrise-superheroes-impact-pop-culture-smithsonianx-popx1-1x-0
08-14 16:26:23.692  14592-14592/org.edx.mobile D/org.edx.mobile.view.FindCoursesActivity? next transition animation applied
08-14 16:26:23.694  14592-14592/org.edx.mobile D/org.edx.mobile.view.custom.URLInterceptorWebViewClient? found course-info URL: edxapp://course_info?path_id=course/rise-superheroes-impact-pop-culture-smithsonianx-popx1-1x-0
08-14 16:26:23.752  14592-14592/org.edx.mobile W/art? Attempt to remove local handle scope entry from IRT, ignoring
08-14 16:26:23.754  14592-14592/org.edx.mobile W/AwContents? onDetachedFromWindow called when already detached. Ignoring
08-14 16:26:23.760  14592-14592/org.edx.mobile D/AndroidRuntime? Shutting down VM
    --------- beginning of crash
08-14 16:26:23.770  14592-14592/org.edx.mobile E/AndroidRuntime? FATAL EXCEPTION: main
    Process: org.edx.mobile, PID: 14592
    java.lang.RuntimeException: Unable to start activity ComponentInfo{org.edx.mobile/org.edx.mobile.view.CourseInfoActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void roboguice.event.EventManager.fire(java.lang.Object)' on a null object reference
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2314)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388)
            at android.app.ActivityThread.access$800(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5312)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)
     Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void roboguice.event.EventManager.fire(java.lang.Object)' on a null object reference
            at roboguice.activity.RoboFragmentActivity.onContentChanged(RoboFragmentActivity.java:136)
            at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:381)
            at android.app.Activity.setContentView(Activity.java:2154)
            at org.edx.mobile.base.FindCoursesBaseActivity.setContentView(FindCoursesBaseActivity.java:46)
            at org.edx.mobile.view.CourseInfoActivity.onCreate(CourseInfoActivity.java:16)
            at android.app.Activity.performCreate(Activity.java:5953)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1128)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2267)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2388)
            at android.app.ActivityThread.access$800(ActivityThread.java:148)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:135)
            at android.app.ActivityThread.main(ActivityThread.java:5312)
            at java.lang.reflect.Method.invoke(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:372)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:901)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:696)

Akiva Leffert

unread,
Aug 14, 2015, 2:15:20 PM8/14/15
to edx-...@googlegroups.com
The key line in that stack trace is
Attempt to invoke virtual method 'org.edx.mobile.util.Config$ZeroRatingConfig org.edx.mobile.util.Config.getZeroRatingConfig()' on a null object reference
This looks like a bug where we assume there’s a valid value for the “zero rating” key, but you haven’t supplied one in your configuration. To work around this you can probably just add an empty value for the ZERO_RATING key to to your yaml configuration file.

That said, the find courses app feature isn’t currently supported for open edX users, as it depends on the edX.org specific front page, which is not currently open source.

For now, I would recommend just adding an extra line to the android code to hide the Find Courses button. I haven’t tested it, but I believe you can just add the following code here https://github.com/edx/edx-app-android/blob/7d3e5d9196ed86aa758fa857afc73d74141bba3e/VideoLocker/src/main/java/org/edx/mobile/view/NavigationFragment.java#L79
tvFindCourses.setVisibility(View.GONE);
A contributions that hid the button automatically you don’t have valid info in your COURSE_ENROLLMENT config key would be welcome. It should be a simple change.

-Akiva Leffert


--
You received this message because you are subscribed to the Google Groups "General Open edX discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msgid/edx-code/82efc657-a216-439c-9245-580483b97317%40googlegroups.com.

Deepak Panwar

unread,
Aug 17, 2015, 5:37:00 AM8/17/15
to General Open edX discussion
I have decrypted the apk and entered all the  valid info in .yaml file.
 I am able to see find course page of edx app which is on playstore. But the problem is with click event to open 
page for enrolling course.
Have you it now. Please read properly and also see the code for Router class
 method name : showCourseInfo
Activity redirection to -> CourseInfoActivity ....in this activity i am getting error. 

Akiva Leffert

unread,
Aug 17, 2015, 1:02:45 PM8/17/15
to General Open edX discussion
Hi,
I'm not sure why you'd be decrypting an apk as part of this process. Can you explain a bit more about what you're doing to make this change?

As I said in previous mail, course enrollment isn't really supported for open edX instances. Did you try my advice from that mail?

-Akiva Leffert
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Deepak Panwar

unread,
Aug 19, 2015, 4:43:57 AM8/19/15
to General Open edX discussion
Hi Akiva

 Can you please describe in which context you are saying the code is not open sourced ?
 At client end in android i am able to see the find course classes and Course Info activity.

Are you saying that at server end the code is not open sourced or you are saying at client end implementation is not done  ?
And if code is not open sourced then when you are going to opensource the code ?

Any help will be appreciated. !

Thanks
Reply all
Reply to author
Forward
0 new messages