When I am loading my application through android studio, I am getting following error:
I have compiled SDL2 library separately using Android.mk/Application.mk and added those so paths in my application.
buildToolsVersion = '23.0.2'
minSdkVersion.apiLevel = 17
targetSdkVersion.apiLevel = 23
Error
FATAL EXCEPTION: main
Process: com.example.hellojni, PID: 14607
java.lang.UnsatisfiedLinkError: dlopen failed: library "libSDL2.so" not found
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.example.hellojni.HelloJni.(HelloJni.java:66)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1095)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3083)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3349)
at android.app.ActivityThread.access$1100(ActivityThread.java:221)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1794)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:158)
at android.app.ActivityThread.main(ActivityThread.java:7224)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
Related
I have a problem while i run app, no coding error but the app has stopped while i run. Maybe like this.
2022-05-23 21:49:21.065 29057-29057/org.d3if0063.garbageanywhere E/AndroidRuntime: FATAL EXCEPTION: main
Process: org.d3if0063.garbageanywhere, PID: 29057
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.d3if0063.garbageanywhere/org.d3if0063.garbageanywhere.MainActivity}: java.lang.IllegalStateException: Activity org.d3if0063.garbageanywhere.MainActivity#c36f0b5 does not have a NavController set on 2131362096
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.IllegalStateException: Activity org.d3if0063.garbageanywhere.MainActivity#c36f0b5 does not have a NavController set on 2131362096
at androidx.navigation.Navigation.findNavController(Navigation.kt:50)
at androidx.navigation.ActivityKt.findNavController(Activity.kt:31)
at org.d3if0063.garbageanywhere.MainActivity.onCreate(MainActivity.kt:26)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
I am trying to factor out some mock bean configuration.
Here is the mock configuration:
#Configuration
public class PvgCacheMockConfiguration {
#Primary
#Bean
public PvgProjectClient pvgProjectClient() {
PvgProjectClient mock = Mockito.mock(PvgProjectClient.class);
when(mock.getAll()).thenReturn(generateMockProjects());
return mock;
}
private ValidationProjects generateMockProjects() {
ValidationProject validationProject = ValidationProject
.builder()
.id("anId")
.code("aCode")
.name("aName")
.projectResponsibleIpn("anIpn")
.batchForMilestone(MilestoneName.PPC)
.type(ValidationProjectType.VEHICLE)
.company(Company.builder().code("aCode").label("aLabel").build())
.withValidationPlanModule(false)
.build();
return ValidationProjects.builder().validationProjects(singletonList(validationProject)).build();
}
}
Here is how I try to import my configuration:
#RunWith(SpringRunner.class)
#SpringBootTest(
webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT,
properties = {"spring.main.web-application-type=reactive"})
#ActiveProfiles("test")
#Sql(scripts = {"classpath:reset.sql",
"classpath:sql/validationSupportNeedRepositoryTest/ValidationSupportNeedEntity.sql"})
#ContextConfiguration(classes = {PvgCacheMockConfiguration.class})
#AutoConfigureWebTestClient
public class ValidationSupportNeedControllerIntegrationTest {
...
Here is the stack trace when I run any test from the above test suite:
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:125)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:108)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:117)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:83)
at org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener.prepareTestInstance(SpringBootDependencyInjectionTestExecutionListener.java:44)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:246)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:227)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:289)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:291)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:246)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.runTestClass(JUnitTestClassExecutor.java:116)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:59)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecutor.execute(JUnitTestClassExecutor.java:39)
at org.gradle.api.internal.tasks.testing.junit.AbstractJUnitTestClassProcessor.processTestClass(AbstractJUnitTestClassProcessor.java:66)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51)
at sun.reflect.GeneratedMethodAccessor27.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy1.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109)
at sun.reflect.GeneratedMethodAccessor26.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:146)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:128)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ReactiveWebApplicationContext due to missing ReactiveWebServerFactory bean.
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:76)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:544)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.refresh(ReactiveWebServerApplicationContext.java:61)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:759)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:395)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:139)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:117)
... 48 more
Caused by: org.springframework.context.ApplicationContextException: Unable to start ReactiveWebApplicationContext due to missing ReactiveWebServerFactory bean.
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.getWebServerFactory(ReactiveWebServerApplicationContext.java:125)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.createWebServer(ReactiveWebServerApplicationContext.java:99)
at org.springframework.boot.web.reactive.context.ReactiveWebServerApplicationContext.onRefresh(ReactiveWebServerApplicationContext.java:73)
... 56 more
From STDOUT:
2018-09-17 14:54:19.759 WARN 12777 --- [ Test worker] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start reactive web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ReactiveWebApplicationContext due to missing ReactiveWebServerFactory bean.
From STDERR:
sept. 17, 2018 2:53:36 PM org.springframework.test.context.support.AbstractContextLoader generateDefaultLocations
INFOS: Could not detect default resource locations for test class [com.renault.digital.pval.prototype.api.rest.controllers.ValidationSupportNeedControllerIntegrationTest]: no resource found for suffixes {-context.xml, Context.groovy}.
sept. 17, 2018 2:53:36 PM org.springframework.boot.test.context.SpringBootTestContextBootstrapper getDefaultTestExecutionListenerClassNames
INFOS: Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener, org.springframework.security.test.context.support.ReactorContextTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
sept. 17, 2018 2:53:36 PM org.springframework.boot.test.context.SpringBootTestContextBootstrapper getTestExecutionListeners
INFOS: Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener#43f48770, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener#32d9e79d, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener#69dc5744, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener#11a74db, org.springframework.test.context.support.DirtiesContextTestExecutionListener#6632bc8f, org.springframework.test.context.transaction.TransactionalTestExecutionListener#1baa4adb, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener#10c7489d, org.springframework.security.test.context.support.WithSecurityContextTestExecutionListener#42a94af2, org.springframework.security.test.context.support.ReactorContextTestExecutionListener#310c50ec, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener#78393884, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener#521004be, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener#5ae62ad4, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener#93e9a54, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener#38f27eef]
Here is my problem, I am converting existing cuucmber junit project to cucumber Testng project. Please find the runner class and console output.
Please let me know how do I resolve this .?
package com.philips.rs.application.setup;
import org.junit.runner.RunWith;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import cucumber.api.testng.AbstractTestNGCucumberTests;
//#RunWith(Cucumber.class)
#CucumberOptions(
format = {"pretty","html:target/cucumber", "json:target/cucumber.json","rerun:target/rerun_featureName.txt"},
features = {"src/test/resources/com.philips.rs.testcases.browser.compatibility/"},
strict = true,
monochrome = true,
glue = {"com.philips.rs.ui.stepdefs","com.philips.rs.backend.stepdefs","com.philips.rs.utils"},
tags = {"#crossBrowser"}
)
public class PBPRunnerCrossBrowserUI_Test extends AbstractTestNGCucumberTests{
}
Please find console output, getting below error saying failed to instantiate runner class. I tried changing testng version in maven dependency , but no luck so far
[RemoteTestNG] detected TestNG version 6.8.2C:\Users\310242019\AppData\Local\Temp\testng-eclipse--1609683828\testng-customsuite.xml
[BaseMessageSender] Waiting for Eclipse client on localhost:23856
[BaseMessageSender] Received a connection from Eclipse on localhost:23856
[BaseMessageSender] Connection established, starting reader thread
[BaseMessageSender] ReaderThread waiting for an admin message
[JsonMessageSender] Sending message [GenericMessage ==> suiteCount:1, testCount:1]
[BaseMessageSender] ReaderThread received admin message:>ACK
[BaseMessageSender] Received ACK:>ACK
[BaseMessageSender] Received ACK:>ACK
org.testng.TestNGException:
Cannot instantiate class com.philips.rs.application.setup.PBPRunnerCrossBrowserUI_Test
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:38)
at org.testng.internal.ClassHelper.createInstance1(ClassHelper.java:387)
at org.testng.internal.ClassHelper.createInstance(ClassHelper.java:299)
at org.testng.internal.ClassImpl.getDefaultInstance(ClassImpl.java:110)
at org.testng.internal.ClassImpl.getInstances(ClassImpl.java:186)
at org.testng.internal.TestNGClassFinder.<init>(TestNGClassFinder.java:120)
at org.testng.TestRunner.initMethods(TestRunner.java:409)
at org.testng.TestRunner.init(TestRunner.java:235)
at org.testng.TestRunner.init(TestRunner.java:205)
at org.testng.TestRunner.<init>(TestRunner.java:160)
at org.testng.remote.support.RemoteTestNG6_5$1.newTestRunner(RemoteTestNG6_5.java:27)
at org.testng.remote.support.RemoteTestNG6_5$DelegatingTestRunnerFactory.newTestRunner(RemoteTestNG6_5.java:63)
at org.testng.SuiteRunner$ProxyTestRunnerFactory.newTestRunner(SuiteRunner.java:561)
at org.testng.SuiteRunner.init(SuiteRunner.java:157)
at org.testng.SuiteRunner.<init>(SuiteRunner.java:111)
at org.testng.TestNG.createSuiteRunner(TestNG.java:1299)
at org.testng.TestNG.createSuiteRunners(TestNG.java:1286)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.testng.internal.ObjectFactoryImpl.newInstance(ObjectFactoryImpl.java:29)
... 21 more
Caused by: java.lang.NoSuchMethodError: cucumber.runtime.RuntimeOptionsFactory.<init>(Ljava/lang/Class;[Ljava/lang/Class;)V
at cucumber.api.testng.AbstractTestNGCucumberTests.<init>(AbstractTestNGCucumberTests.java:27)
at com.philips.rs.application.setup.PBPRunnerCrossBrowserUI_Test.<init>(PBPRunnerCrossBrowserUI_Test.java:19)
... 26 more
java.net.SocketException: Socket closed
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:171)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:284)
at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:326)
at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.io.InputStreamReader.read(InputStreamReader.java:184)
at java.io.BufferedReader.fill(BufferedReader.java:161)
at java.io.BufferedReader.readLine(BufferedReader.java:324)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at org.testng.remote.strprotocol.BaseMessageSender$ReaderThread.run(BaseMessageSender.java:267)
The Error is as below:
02-11 13:24:31.561 5262-5262/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.vicky.project, PID: 5262
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.example.vicky.project/com.example.vicky.project.MainActivity}:
java.lang.ClassCastException:
android.support.v7.widget.AppCompatTextView cannot be cast to
android.widget.EditText
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Caused by: java.lang.ClassCastException:
android.support.v7.widget.AppCompatTextView cannot be cast to
android.widget.EditText
at com.example.vicky.project.MainActivity.onCreate(MainActivity.java:30)
at android.app.Activity.performCreate(Activity.java:6662)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2599)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)
Look at this carefully
{android.support.v7.widget.AppCompatTextView cannot be cast to android.widget.EditText at com.example.vicky.project.MainActivity.onCreate(MainActivity.java:30) }
You may did this
{TextView tv = (EditText/*change this to TextView*/) findViewById (R.id.textView)}
If you are sure your code is correct then change ID of view in layout.xml then clean project from under the build options and rebuild it.
Class cast Exception because you're trying to cast TextView to EditText.
I've downloaded the Ceylon SDK and try to play a little bit, but after a while I realize of this:
...
SDK
At this time, the only module available is the language module
ceylon.language, included in the distribution.
http://ceylon-lang.org/blog/2011/12/20/ceylon-m1-newton/
Would that explain why am I getting ClassNotFoundException here? Or am I missing something else?
$cat source/time.ceylon
import javax.swing { JFrame }
void run() {
print( "Yeap, it's working ");
value frame = JFrame();
frame.pack();
frame.visible := true;
}
$../../bin/ceylonc default
error: warning: Has multiple constructors: javax.swing.JFrame
error: warning: Has conflicting attribute and method name 'layout': javax.swing.JFrame
error: warning: Has conflicting attribute and method name 'iconImage': javax.swing.JFrame
error: warning: Has multiple constructors: java.awt.Frame
error: warning: Has conflicting attribute and method name 'cursor': java.awt.Frame
error: warning: Has multiple constructors: java.awt.Window
error: warning: Has conflicting attribute and method name 'cursor': java.awt.Window
error: warning: Has conflicting attribute and method name 'minimumSize': java.awt.Window
error: warning: Has conflicting attribute and method name 'visible': java.awt.Window
error: warning: Has conflicting attribute and method name 'locationRelativeTo': java.awt.Window
error: warning: Has conflicting attribute and method name 'size': java.awt.Window
error: warning: Has conflicting attribute and method name 'bounds': java.awt.Window
error: warning: Has conflicting attribute and method name 'iconImage': java.awt.Window
error: warning: Has conflicting attribute and method name 'font': java.awt.Container
14 warnings
$../../bin/ceylon default
Note: Ceylon repository 'http://modules.ceylon-lang.org' not yet available.
Yeap, it's working
Exception in thread "main" java.lang.RuntimeException: Error using Ceylon Runtime.
at ceylon.modules.Main.main(Main.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jboss.modules.Module.run(Module.java:243)
at org.jboss.modules.Main.main(Main.java:313)
Caused by: java.security.PrivilegedActionException: java.lang.reflect.InvocationTargetException
at java.security.AccessController.doPrivileged(Native Method)
at ceylon.modules.api.runtime.SecurityActions.invokeRun(SecurityActions.java:59)
at ceylon.modules.api.runtime.AbstractRuntime.invokeRun(AbstractRuntime.java:69)
at ceylon.modules.api.runtime.AbstractRuntime.execute(AbstractRuntime.java:109)
at ceylon.modules.Main.execute(Main.java:76)
at ceylon.modules.Main.main(Main.java:55)
... 6 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at ceylon.modules.api.runtime.SecurityActions$2.run(SecurityActions.java:66)
... 12 more
Caused by: java.lang.NoClassDefFoundError: javax/swing/JFrame
at run.run(time.ceylon:4)
at run.main(time.ceylon)
... 17 more
Caused by: java.lang.ClassNotFoundException: javax.swing.JFrame from [Module "default:**NO_VERSION**" from Ceylon ModuleLoader: RootRepository: FileContentStore: /Users/oscarryz/.ceylon/repo]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:485)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:444)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:421)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:143)
... 19 more
Java interop is not ready yet, so M1 does not include it. It's planned for M2:
http://ceylon-lang.org/documentation/roadmap/#milestone_2