Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...
Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk...
Syncing files to device Android SDK built for x86...
I/Choreographer( 8919): Skipped 218 frames! The application may be doing too much work on its main thread.
D/EGL_emulation( 8919): eglMakeCurrent: 0x9f885ae0: ver 3 1 (tinfo 0x8732ce90)
I/OpenGLRenderer( 8919): Davey! duration=5004ms; Flags=1, IntendedVsync=28978637647800, Vsync=28982270980988, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=28982277777820, AnimationStart=28982277869920, PerformTraversalsStart=28982281804220, DrawStart=28982298938620, SyncQueued=28982312673220, SyncStart=28982336675620, IssueDrawCommandsStart=28982450126320, SwapBuffers=28982885248420, FrameCompleted=28983666130020, DequeueBufferDuration=527796000, QueueBufferDuration=4732000,
D/EGL_emulation( 8919): eglMakeCurrent: 0x9ce94f60: ver 3 1 (tinfo 0xededdde0)
I/Choreographer( 8919): Skipped 30 frames! The application may be doing too much work on its main thread.
D/skia ( 8919): Shader compilation error
D/skia ( 8919): ------------------------
D/skia ( 8919): Errors:
D/skia ( 8919):
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during layout:
A RenderFlex overflowed by 37 pixels on the bottom.
User-created ancestor of the error-causing widget was:
Padding file:///C:/Users/OROAD/AndroidStudioProjects/enichat/lib/screens/registration_screen.dart:24:13
The overflowing RenderFlex has an orientation of Axis.vertical.
The edge of the RenderFlex that is overflowing has been marked in the rendering with a yellow and black striped pattern. This is usually caused by the contents being too big for the RenderFlex.
Consider applying a flex factor (e.g. using an Expanded widget) to force the children of the RenderFlex to fit within the available space instead of being sized to their natural size.
This is considered an error condition because it indicates that there is content that cannot be seen. If the content is legitimately bigger than the available space, consider clipping it with a ClipRect widget before putting it in the flex, or using a scrollable container rather than a Flex, like a ListView.
The specific RenderFlex in question is: RenderFlex#4c912 relayoutBoundary=up2 OVERFLOWING
... needs compositing
... parentData: offset=Offset(24.0, 0.0) (can use size)
... constraints: BoxConstraints(0.0<=w<=363.4, 0.0<=h<=401.4)
... size: Size(363.4, 401.4)
... direction: vertical
... mainAxisAlignment: center
... mainAxisSize: max
... crossAxisAlignment: stretch
... verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
════════════════════════════════════════════════════════════════════════════════════════════════════
D/skia ( 8919): Shader compilation error
D/skia ( 8919): ------------------------
D/skia ( 8919): Errors:
D/skia ( 8919):
D/skia ( 8919): Shader compilation error
D/skia ( 8919): ------------------------
D/skia ( 8919): Errors:
D/skia ( 8919):
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.createUserWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.handleCreateUserWithEmailAndPassword(FirebaseAuthPlugin.java:312)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.onMethodCall(FirebaseAuthPlugin.java:93)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/flutter ( 8919): PlatformException(error, Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.createUserWithEmailAndPassword(java.lang.String, java.lang.String)' on a null object reference, null)
D/skia ( 8919): Shader compilation error
D/skia ( 8919): ------------------------
D/skia ( 8919): Errors:
D/skia ( 8919):
════════ (2) Exception caught by rendering library ═════════════════════════════════════════════════
A RenderFlex overflowed by 37 pixels on the bottom.
User-created ancestor of the error-causing widget was:
Padding file:///C:/Users/OROAD/AndroidStudioProjects/enichat/lib/screens/login_screen.dart:22:13
════════════════════════════════════════════════════════════════════════════════════════════════════
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): Failed to handle method call
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): java.lang.NullPointerException: Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithCredential(com.google.firebase.auth.AuthCredential)' on a null object reference
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.handleSignInWithCredential(FirebaseAuthPlugin.java:478)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugins.firebaseauth.FirebaseAuthPlugin.onMethodCall(FirebaseAuthPlugin.java:120)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:222)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:96)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:656)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.MessageQueue.next(MessageQueue.java:326)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.os.Looper.loop(Looper.java:160)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at android.app.ActivityThread.main(ActivityThread.java:6669)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/MethodChannel#plugins.flutter.io/firebase_auth( 8919): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
I/flutter ( 8919): PlatformException(error, Attempt to invoke virtual method 'com.google.android.gms.tasks.Task com.google.firebase.auth.FirebaseAuth.signInWithCredential(com.google.firebase.auth.AuthCredential)' on a null object reference, null)
Related
I'm trying to connect a android.webkit.WebView object to a NativeActivity, but I'm failing simply trying to create the WebView object. That code looks like this
#[cfg(target_os = "android")]
pub fn setup(ctx: AndroidContext, env: AttachGuard) -> JObject {
let class = env.find_class("android/webkit/WebView").unwrap();
let context: *mut _jobject = ctx.context().cast();
let webview = env
.new_object(
class,
"(Landroid/content/Context;)V",
&[JValue::Object(context.into())],
)
.unwrap();
env.call_method(
context,
"setContentView",
"(Landroid/view/View;)V",
&[webview.into()],
)
.unwrap()
.v()
.unwrap();
...
}
When I try to create the WebView I see this crash with logcat
06-26 23:17:30.471 30695 30727 E AndroidRuntime: FATAL EXCEPTION: Thread-2
06-26 23:17:30.471 30695 30727 E AndroidRuntime: Process: rust.example.android, PID: 30695
06-26 23:17:30.471 30695 30727 E AndroidRuntime: java.lang.RuntimeException: WebView cannot be initialized on a thread that has no Looper.
06-26 23:17:30.471 30695 30727 E AndroidRuntime: at android.webkit.WebView.<init>(WebView.java:670)
06-26 23:17:30.471 30695 30727 E AndroidRuntime: at android.webkit.WebView.<init>(WebView.java:604)
06-26 23:17:30.471 30695 30727 E AndroidRuntime: at android.webkit.WebView.<init>(WebView.java:587)
06-26 23:17:30.471 30695 30727 E AndroidRuntime: at android.webkit.WebView.<init>(WebView.java:574)
06-26 23:17:30.471 30695 30727 E AndroidRuntime: at android.webkit.WebView.<init>(WebView.java:564)
It appears that from the context on the rust side there is a looper (based on getting the ThreadLooper via a call to for_thread and checking that it's not storing a null pointer). However it does appear that there isn't one from the JVM perspective since attempts to log the results of a call to myLooper on the android.os.Looper object via JNI yields a null looper. I suppose this makes sense since the UI loop was not setup the way it normally would be with a Java / Kotlin Android app. The question is, is there a way around this?
Can I execute the JNI calls within a context that's part of the the non-null looper, or share that looper with the JNI context, or create a looper via JNI for the context within the JVM. Since this is supposed to be part of a rust library I'm try to avoid needing to add any java boiler plate. Is there a way to avoid that? I'm not exactly an Android or JNI expert so I'm pretty far out over my skis with this project. Any help is appreciated.
By far the simplest solution is simply to launch a new (non-native) activity for the duration of the web interaction.
If you cannot do that, you will have to do (at least) the following:
Call the Java Looper.prepare() method to associate your thread with a Looper
Instantiate the WebView component
Set up the necessary callbacks such that eventually quit() is called on the Looper instance
Give up control of the current thread with Looper.loop().
This is my first post on stack overflow. So my app keeps stopping after I hit a button that should play a censor noise. It just crashes.
I tried looking up various solutions but nothing is coming up.
package com.example.soundbutton;
import androidx.appcompat.app.AppCompatActivity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity{
Button bleep;
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
bleep = (Button) findViewById(R.id.bleep);
final MediaPlayer bleepMP = MediaPlayer.create(this, R.raw.censor);
bleep.setOnClickListener(new View.OnClickListener(){
#Override
public void onClick(View V) {
bleepMP.start();
}
});
}
}
Below is information after running through and emulator. I am still not too sure what exactly i am looking at. From what i can infer, it would seem as if i am pointing to some null value. I tried initializing the mp value as a null and setting a condition where if it were null, then it would start the onclick.
Here is the information after running in an emulator `code`11/20 14:20:48: Launching 'app' on Pixel XL API 29.
$ adb shell am start -n "com.example.soundbutton/com.example.soundbutton.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Waiting for process to come online...
Connected to process 21565 on device 'emulator-5554'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/ple.soundbutto: Not late-enabling -Xcheck:jni (already on)
E/ple.soundbutto: Unknown bits set in runtime_flags: 0x8000
W/ple.soundbutto: Unexpected CPU variant for X86 using defaults: x86
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
W/RenderThread: type=1400 audit(0.0:53): avc: denied { write } for name="property_service" dev="tmpfs" ino=7228 scontext=u:r:untrusted_app:s0:c136,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.soundbutton
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/ple.soundbutto: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
E/MediaPlayerNative: error (1, -2147483648)
D/MediaPlayer: create failed:
java.io.IOException: Prepare failed.: status=0x1
at android.media.MediaPlayer._prepare(Native Method)
at android.media.MediaPlayer.prepare(MediaPlayer.java:1274)
at android.media.MediaPlayer.create(MediaPlayer.java:977)
at android.media.MediaPlayer.create(MediaPlayer.java:948)
at com.example.soundbutton.MainActivity.onCreate(MainActivity.java:20)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
D/HostConnection: HostConnection::get() New Host Connection established 0xd9bd3fa0, tid 21629
D/HostConnection: HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xe51d4400: maj 3 min 1 rcv 4
D/EGL_emulation: eglMakeCurrent: 0xe51d4400: ver 3 1 (tinfo 0xf04c02e0)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
glUtilsParamSize: unknow param 0x000082da
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xd9bd5800, tid 21629
HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1
D/eglCodecCommon: allocate: Ask for block of size 0x1000
D/eglCodecCommon: allocate: ioctl allocate returned offset 0x3ff1dc000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xe51d4400: ver 3 1 (tinfo 0xf04c02e0)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
I/Choreographer: Skipped 43 frames! The application may be doing too much work on its main thread.
W/MediaPlayer-JNI: MediaPlayer finalized without being released
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.soundbutton, PID: 21565
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.media.MediaPlayer.start()' on a null object reference
at com.example.soundbutton.MainActivity$1.onClick(MainActivity.java:25)
at android.view.View.performClick(View.java:7125)
at android.view.View.performClickInternal(View.java:7102)
at android.view.View.access$3500(View.java:801)
at android.view.View$PerformClick.run(View.java:27336)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Process 21565 terminated.
E/AndroidRuntime: FATAL EXCEPTION: main
Process: able.works, PID: 22667
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.XmlResourceParser android.content.pm.ProviderInfo.loadXmlMetaData(android.content.pm.PackageManager, java.lang.String)' on a null object reference
at android.support.v4.content.FileProvider.parsePathStrategy(FileProvider.java:591)
at android.support.v4.content.FileProvider.getPathStrategy(FileProvider.java:565)
at android.support.v4.content.FileProvider.getUriForFile(FileProvider.java:403)
at droidninja.filepicker.utils.ImageCaptureManager.dispatchTakePictureIntent(ImageCaptureManager.java:71)
at droidninja.filepicker.fragments.MediaFolderPickerFragment.onCameraClicked(MediaFolderPickerFragment.java:223)
at droidninja.filepicker.adapters.FolderGridAdapter$2.onClick(FolderGridAdapter.java:97)
at android.view.View.performClick(View.java:5623)
at android.view.View$PerformClick.run(View.java:22433)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6316)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:872)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:762)
I'm using cabal here to install package c2hs. However, it requires happy, so I installed happy with cabal install happy.
After, when trying to install c2hs and language-c I get package happy not found on both.
Here's the terminal log:
~> cabal install happy
Resolving dependencies...
[1 of 1] Compiling Main ( /tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs, /tmp/happy-1.18.9-12936/happy-1.18.9/dist/setup/Main.o )
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:6:52:
Warning: In the use of `buildVerbose'
(imported from Distribution.Simple.Setup):
Deprecated: "Use buildVerbosity instead"
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:7:52:
Warning: In the use of `defaultUserHooks'
(imported from Distribution.Simple):
Deprecated: "Use simpleUserHooks or autoconfUserHooks, unless you need Cabal-1.2
compatibility in which case you must stick with defaultUserHooks"
/tmp/happy-1.18.9-12936/happy-1.18.9/Setup.lhs:12:26:
Warning: In the use of `try'
(imported from System.IO.Error):
Deprecated: "Please use the new exceptions variant, Control.Exception.try"
Linking /tmp/happy-1.18.9-12936/happy-1.18.9/dist/setup/setup ...
Warning: defaultUserHooks in Setup script is deprecated.
Configuring happy-1.18.9...
Building happy-1.18.9...
Preprocessing executable 'happy' for happy-1.18.9...
[ 1 of 18] Compiling NameSet ( src/NameSet.hs, dist/build/happy/happy-tmp/NameSet.o )
[ 2 of 18] Compiling Target ( src/Target.lhs, dist/build/happy/happy-tmp/Target.o )
[ 3 of 18] Compiling AbsSyn ( src/AbsSyn.lhs, dist/build/happy/happy-tmp/AbsSyn.o )
[ 4 of 18] Compiling ParamRules ( src/ParamRules.hs, dist/build/happy/happy-tmp/ParamRules.o )
[ 5 of 18] Compiling GenUtils ( src/GenUtils.lhs, dist/build/happy/happy-tmp/GenUtils.o )
[ 6 of 18] Compiling ParseMonad ( src/ParseMonad.lhs, dist/build/happy/happy-tmp/ParseMonad.o )
[ 7 of 18] Compiling Lexer ( src/Lexer.lhs, dist/build/happy/happy-tmp/Lexer.o )
[ 8 of 18] Compiling Parser ( dist/build/happy/happy-tmp/Parser.hs, dist/build/happy/happy-tmp/Parser.o )
[ 9 of 18] Compiling AttrGrammar ( src/AttrGrammar.lhs, dist/build/happy/happy-tmp/AttrGrammar.o )
[10 of 18] Compiling AttrGrammarParser ( dist/build/happy/happy-tmp/AttrGrammarParser.hs, dist/build/happy/happy-tmp/AttrGrammarParser.o )
[11 of 18] Compiling Grammar ( src/Grammar.lhs, dist/build/happy/happy-tmp/Grammar.o )
[12 of 18] Compiling First ( src/First.lhs, dist/build/happy/happy-tmp/First.o )
[13 of 18] Compiling LALR ( src/LALR.lhs, dist/build/happy/happy-tmp/LALR.o )
[14 of 18] Compiling Paths_happy ( dist/build/autogen/Paths_happy.hs, dist/build/happy/happy-tmp/Paths_happy.o )
[15 of 18] Compiling ProduceCode ( src/ProduceCode.lhs, dist/build/happy/happy-tmp/ProduceCode.o )
[16 of 18] Compiling ProduceGLRCode ( src/ProduceGLRCode.lhs, dist/build/happy/happy-tmp/ProduceGLRCode.o )
[17 of 18] Compiling Info ( src/Info.lhs, dist/build/happy/happy-tmp/Info.o )
[18 of 18] Compiling Main ( src/Main.lhs, dist/build/happy/happy-tmp/Main.o )
Linking dist/build/happy/happy ...
Installing executable(s) in /home/david/.cabal/bin
~> cabal install c2hs
Resolving dependencies...
Configuring language-c-0.3.2.1...
cabal: The program happy is required but it could not be found.
cabal: Error: some packages failed to install:
c2hs-0.16.3 depends on language-c-0.3.2.1 which failed to install.
language-c-0.3.2.1 failed during the configure step. The exception was:
ExitFailure 1
exit 1
~> cabal install language-c
Resolving dependencies...
Configuring language-c-0.4.2...
cabal: The program happy is required but it could not be found.
cabal: Error: some packages failed to install:
language-c-0.4.2 failed during the configure step. The exception was:
ExitFailure 1
exit 1
~>
Any ideas? Thank you.
I had to add ~/.cabal/bin to my path, and then it worked.
hello I got some error
on windows xp sp3,
I tried
install up to date Haskell platform
install gtk+ all in one bundle 2.16
add MinGW's bin address to PATH Environment variables
add GTK+'s bin address to PATH Environment variables
and on CMD
I execute the
cabal update
cabal install gtk2hs-buildtools
so far so good
but when I execute the
cabal install gtk
the error arise
here's dump
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\dreambook>cabal install gtk
Resolving dependencies...
C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.0808\cairo-0.12.0\Gtk2HsSetup.hs:2
5:2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation
of Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when buil
ding (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\Gtk2HsSetup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\dist\setup\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0
.12.0808\cairo-0.12.0\Setup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.08
08\cairo-0.12.0\dist\setup\Main.o )
Linking C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\cairo-0.12.0808\cairo-0.12.0\dist\set
up\setup.exe ...
Configuring cairo-0.12.0...
Preprocessing library cairo-0.12.0...
Building cairo-0.12.0...
[ 1 of 17] Compiling Graphics.Rendering.Cairo.Matrix ( dist\build\Graphics\Rende
ring\Cairo\Matrix.hs, dist\build\Graphics\Rendering\Cairo\Matrix.o )
[ 2 of 17] Compiling Graphics.Rendering.Cairo.Types ( dist\build\Graphics\Render
ing\Cairo\Types.hs, dist\build\Graphics\Rendering\Cairo\Types.o )
[ 3 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Cairo ( dist\buil
d\Graphics\Rendering\Cairo\Internal\Drawing\Cairo.hs, dist\build\Graphics\Render
ing\Cairo\Internal\Drawing\Cairo.o )
[ 4 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Paths ( dist\buil
d\Graphics\Rendering\Cairo\Internal\Drawing\Paths.hs, dist\build\Graphics\Render
ing\Cairo\Internal\Drawing\Paths.o )
[ 5 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Patterns ( dist\b
uild\Graphics\Rendering\Cairo\Internal\Drawing\Patterns.hs, dist\build\Graphics\
Rendering\Cairo\Internal\Drawing\Patterns.o )
[ 6 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Text ( dist\build
\Graphics\Rendering\Cairo\Internal\Drawing\Text.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Drawing\Text.o )
[ 7 of 17] Compiling Graphics.Rendering.Cairo.Internal.Drawing.Transformations (
dist\build\Graphics\Rendering\Cairo\Internal\Drawing\Transformations.hs, dist\b
uild\Graphics\Rendering\Cairo\Internal\Drawing\Transformations.o )
[ 8 of 17] Compiling Graphics.Rendering.Cairo.Internal.Fonts.FontOptions ( dist\
build\Graphics\Rendering\Cairo\Internal\Fonts\FontOptions.hs, dist\build\Graphic
s\Rendering\Cairo\Internal\Fonts\FontOptions.o )
[ 9 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.Image ( dist\bui
ld\Graphics\Rendering\Cairo\Internal\Surfaces\Image.hs, dist\build\Graphics\Rend
ering\Cairo\Internal\Surfaces\Image.o )
[10 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PDF ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\PDF.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\PDF.o )
[11 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PNG ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\PNG.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\PNG.o )
[12 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.PS ( dist\build\
Graphics\Rendering\Cairo\Internal\Surfaces\PS.hs, dist\build\Graphics\Rendering\
Cairo\Internal\Surfaces\PS.o )
[13 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.SVG ( dist\build
\Graphics\Rendering\Cairo\Internal\Surfaces\SVG.hs, dist\build\Graphics\Renderin
g\Cairo\Internal\Surfaces\SVG.o )
[14 of 17] Compiling Graphics.Rendering.Cairo.Internal.Surfaces.Surface ( dist\b
uild\Graphics\Rendering\Cairo\Internal\Surfaces\Surface.hs, dist\build\Graphics\
Rendering\Cairo\Internal\Surfaces\Surface.o )
[15 of 17] Compiling Graphics.Rendering.Cairo.Internal.Utilities ( dist\build\Gr
aphics\Rendering\Cairo\Internal\Utilities.hs, dist\build\Graphics\Rendering\Cair
o\Internal\Utilities.o )
[16 of 17] Compiling Graphics.Rendering.Cairo.Internal ( Graphics\Rendering\Cair
o\Internal.hs, dist\build\Graphics\Rendering\Cairo\Internal.o )
[17 of 17] Compiling Graphics.Rendering.Cairo ( Graphics\Rendering\Cairo.hs, dis
t\build\Graphics\Rendering\Cairo.o )
Registering cairo-0.12.0...
Installing library in C:\Documents and Settings\dreambook\Application
Data\cabal\cairo-0.12.0\ghc-7.0.3
Registering cairo-0.12.0...
setup.exe: internal error: unexpected package db stack: [UserPackageDB]
C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\glib-0.12.0\Gtk2HsSetup.hs:25:
2: warning: #warning Setup.hs is guessing the version of Cabal. If compilation o
f Setup.hs fails use -DCABAL_VERSION_MINOR=x for Cabal version 1.x.0 when buildi
ng (prefixed by --ghc-option= when using the 'cabal' command)
[1 of 2] Compiling Gtk2HsSetup ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.
12.0808\glib-0.12.0\Gtk2HsSetup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12
.0808\glib-0.12.0\dist\setup\Gtk2HsSetup.o )
[2 of 2] Compiling Main ( C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.
12.0808\glib-0.12.0\Setup.hs, C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\
glib-0.12.0\dist\setup\Main.o )
Linking C:\DOCUME~1\DREAMB~1\LOCALS~1\Temp\glib-0.12.0808\glib-0.12.0\dist\setup
\setup.exe ...
Configuring glib-0.12.0...
Preprocessing library glib-0.12.0...
Building glib-0.12.0...
[ 1 of 20] Compiling System.Glib.Attributes ( System\Glib\Attributes.hs, dist\bu
ild\System\Glib\Attributes.o )
[ 2 of 20] Compiling System.Glib.Flags ( System\Glib\Flags.hs, dist\build\System
\Glib\Flags.o )
[ 3 of 20] Compiling System.Glib.FFI ( System\Glib\FFI.hs, dist\build\System\Gl
ib\FFI.o )
[ 4 of 20] Compiling System.Glib.Types ( dist\build\System\Glib\Types.hs, dist\b
uild\System\Glib\Types.o )
[ 5 of 20] Compiling System.Glib.GList ( dist\build\System\Glib\GList.hs, dist\b
uild\System\Glib\GList.o )
[ 6 of 20] Compiling System.Glib.GType ( dist\build\System\Glib\GType.hs, dist\b
uild\System\Glib\GType.o )
[ 7 of 20] Compiling System.Glib.GValue ( dist\build\System\Glib\GValue.hs, dist
\build\System\Glib\GValue.o )
[ 8 of 20] Compiling System.Glib.GParameter ( dist\build\System\Glib\GParameter.
hs, dist\build\System\Glib\GParameter.o )
[ 9 of 20] Compiling System.Glib.GTypeConstants ( dist\build\System\Glib\GTypeCo
nstants.hs, dist\build\System\Glib\GTypeConstants.o )
[10 of 20] Compiling System.Glib.UTFString ( System\Glib\UTFString.hs, dist\buil
d\System\Glib\UTFString.o )
[11 of 20] Compiling System.Glib.GObject ( dist\build\System\Glib\GObject.hs, di
st\build\System\Glib\GObject.o )
[12 of 20] Compiling System.Glib.GValueTypes ( dist\build\System\Glib\GValueType
s.hs, dist\build\System\Glib\GValueTypes.o )
[13 of 20] Compiling System.Glib.Properties ( dist\build\System\Glib\Properties.
hs, dist\build\System\Glib\Properties.o )
[14 of 20] Compiling System.Glib.StoreValue ( dist\build\System\Glib\StoreValue.
hs, dist\build\System\Glib\StoreValue.o )
System\Glib\StoreValue.hsc:38:1:
Warning: Module `Control.OldException' is deprecated:
Future versions of base will not support the old exceptions style
. Please switch to extensible exceptions.
System\Glib\StoreValue.hsc:38:1:
Warning: In the use of data constructor `AssertionFailed'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
[15 of 20] Compiling System.Glib.Signals ( dist\build\System\Glib\Signals.hs, di
st\build\System\Glib\Signals.o )
[16 of 20] Compiling System.Glib.MainLoop ( dist\build\System\Glib\MainLoop.hs,
dist\build\System\Glib\MainLoop.o )
[17 of 20] Compiling System.Glib.GError ( dist\build\System\Glib\GError.hs, dist
\build\System\Glib\GError.o )
System\Glib\GError.chs:93:1:
Warning: Module `Control.OldException' is deprecated:
Future versions of base will not support the old exceptions style
. Please switch to extensible exceptions.
System\Glib\GError.chs:93:1:
Warning: In the use of `catchDyn'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
System\Glib\GError.chs:93:1:
Warning: In the use of `throwDyn'
(imported from Control.OldException):
Deprecated: "Future versions of base will not support the old excep
tions style. Please switch to extensible exceptions."
[18 of 20] Compiling System.Glib.GDateTime ( dist\build\System\Glib\GDateTime.hs
, dist\build\System\Glib\GDateTime.o )
[19 of 20] Compiling System.Glib.Utils ( dist\build\System\Glib\Utils.hs, dist\b
uild\System\Glib\Utils.o )
[20 of 20] Compiling System.Glib ( System\Glib.hs, dist\build\System\Glib.o
)
Registering glib-0.12.0...
Installing library in C:\Documents and Settings\dreambook\Application
Data\cabal\glib-0.12.0\ghc-7.0.3
Registering glib-0.12.0...
setup.exe: internal error: unexpected package db stack: [UserPackageDB]
cabal: Error: some packages failed to install:
cairo-0.12.0 failed during the final install step. The exception was:
ExitFailure 1
gio-0.12.0 depends on glib-0.12.0 which failed to install.
glib-0.12.0 failed during the final install step. The exception was:
ExitFailure 1
gtk-0.12.0 depends on glib-0.12.0 which failed to install.
pango-0.12.0 depends on glib-0.12.0 which failed to install.
You're hitting a bug in Gtk2hsSetup.hs, the bug and a workaround is described here.
I would recommend adding yourself to that ticket on the trac so that you'll be notified when a fix becomes available.
Install those packages in the global package directory using the --global option.
For instance: cabal install cairo --global