Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jep Initialization crashes all the time #519

Open
fakudzesamj opened this issue Feb 6, 2024 · 1 comment
Open

Jep Initialization crashes all the time #519

fakudzesamj opened this issue Feb 6, 2024 · 1 comment

Comments

@fakudzesamj
Copy link

fakudzesamj commented Feb 6, 2024

Describe the problem
import jep.SharedInterpreter;
import jep.JepException;

public class MainActivity extends AppCompatActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    

}
public void onActionBt(View view) {
    SharedInterpreter jep = null;
    try {
        **jep = new SharedInterpreter();**

// crashes above giving me an error java.lang.IllegalStateException: Could not execute method for android:onClick

        jep.runScript("prikle.py");
    } catch (JepException e) {
        throw new RuntimeException(e);
    }

this code crashes all the time, realy how do you declare and initialize a Jep

Environment (please complete the following information):

  • OS Platform, Distribution, and Version: WIN 11
  • Python Distribution and Version:
  • Java Distribution and Version:JDK 1.8
  • Jep Version:4.2.0
  • Python packages used (e.g. numpy,):
@bsteffensmeier
Copy link
Member

You should close the SharedINterpreter when you are done with it. If that does not solve it then the exception you mentioned is coming from android, not from jep, if there is a caused by that implicates jep please include it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants